Changeset 88021 in webkit


Ignore:
Timestamp:
Jun 3, 2011 9:00:25 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-03 Naoki Takano <takano.naoki@gmail.com>

Reviewed by Eric Seidel.

[Chromium] Call setToolTipText() in WebPopupMenuImpl mouse move handler to show tool tip in select popup window.
https://bugs.webkit.org/show_bug.cgi?id=61260
http://code.google.com/p/chromium/issues/detail?id=12721

Manual test: select-popup-tooltip-test.html

  • manual-tests/select-popup-tooltip-test.html: Added.
  • platform/chromium/PopupMenuChromium.cpp: (WebCore::PopupContainer::getSelectedItemToolTip): Get selected item tooltip string according to hovering mouse position.
  • platform/chromium/PopupMenuChromium.h: Add getSelectedItemToolTip() declaration.

2011-06-03 Naoki Takano <takano.naoki@gmail.com>

Reviewed by Eric Seidel.

[Chromium] Call setToolTipText() in WebPopupMenuImpl mouse move handler to show tool tip in select popup window.
https://bugs.webkit.org/show_bug.cgi?id=61260
http://code.google.com/p/chromium/issues/detail?id=12721

  • public/WebMenuItemInfo.h: Add toolTip.
  • public/WebViewClient.h: Remove setToolTipText().
  • public/WebWidgetClient.h: Add setTooTipText(). (WebKit::WebWidgetClient::setToolTipText):
  • src/ExternalPopupMenu.cpp: (WebKit::ExternalPopupMenu::getPopupMenuInfo): Add popupItem.toolTip set.
  • src/WebPopupMenuImpl.cpp: (WebKit::WebPopupMenuImpl::MouseMove): Call setToolTipText().
Location:
trunk/Source
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88020 r88021  
     12011-06-03  Naoki Takano  <takano.naoki@gmail.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [Chromium] Call setToolTipText() in WebPopupMenuImpl mouse move handler to show tool tip in select popup window.
     6        https://bugs.webkit.org/show_bug.cgi?id=61260
     7        http://code.google.com/p/chromium/issues/detail?id=12721
     8
     9        Manual test: select-popup-tooltip-test.html
     10
     11        * manual-tests/select-popup-tooltip-test.html: Added.
     12        * platform/chromium/PopupMenuChromium.cpp:
     13        (WebCore::PopupContainer::getSelectedItemToolTip): Get selected item tooltip string according to hovering mouse position.
     14        * platform/chromium/PopupMenuChromium.h: Add getSelectedItemToolTip() declaration.
     15
    1162011-06-03  Rob Buis  <rbuis@rim.com>
    217
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp

    r87932 r88021  
    615615{
    616616    return m_listBox->items();
     617}
     618
     619String PopupContainer::getSelectedItemToolTip()
     620{
     621    // We cannot use m_popupClient->selectedIndex() to choose tooltip message,
     622    // because the selectedIndex() might return final selected index, not hovering selection.
     623    return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex);
    617624}
    618625
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h

    r79294 r88021  
    168168    PopupType popupType() const { return m_popupType; }
    169169
     170    // While hovering popup menu window, we want to show tool tip message.
     171    String getSelectedItemToolTip();
     172
    170173private:
    171174    friend class WTF::RefCounted<PopupContainer>;
  • trunk/Source/WebKit/chromium/ChangeLog

    r88019 r88021  
     12011-06-03  Naoki Takano  <takano.naoki@gmail.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [Chromium] Call setToolTipText() in WebPopupMenuImpl mouse move handler to show tool tip in select popup window.
     6        https://bugs.webkit.org/show_bug.cgi?id=61260
     7        http://code.google.com/p/chromium/issues/detail?id=12721
     8
     9        * public/WebMenuItemInfo.h: Add toolTip.
     10        * public/WebViewClient.h: Remove setToolTipText().
     11        * public/WebWidgetClient.h: Add setTooTipText().
     12        (WebKit::WebWidgetClient::setToolTipText):
     13        * src/ExternalPopupMenu.cpp:
     14        (WebKit::ExternalPopupMenu::getPopupMenuInfo): Add popupItem.toolTip set.
     15        * src/WebPopupMenuImpl.cpp:
     16        (WebKit::WebPopupMenuImpl::MouseMove): Call setToolTipText().
     17
    1182011-06-03  Hans Wennborg  <hans@chromium.org>
    219
  • trunk/Source/WebKit/chromium/public/WebMenuItemInfo.h

    r80862 r88021  
    5858
    5959    WebString label;
     60    WebString toolTip;
    6061    Type type;
    6162    unsigned action;
  • trunk/Source/WebKit/chromium/public/WebViewClient.h

    r86047 r88021  
    228228    virtual void setKeyboardFocusURL(const WebURL&) { }
    229229
    230     // Called when a tooltip should be shown at the current cursor position.
    231     virtual void setToolTipText(const WebString&, WebTextDirection hint) { }
    232 
    233230    // Shows a context menu with commands relevant to a specific element on
    234231    // the given frame. Additional context data is supplied.
  • trunk/Source/WebKit/chromium/public/WebWidgetClient.h

    r76278 r88021  
    3939namespace WebKit {
    4040
     41class WebString;
    4142class WebWidget;
    4243struct WebCursorInfo;
     
    8283    virtual void setWindowRect(const WebRect&) { }
    8384
     85    // Called when a tooltip should be shown at the current cursor position.
     86    virtual void setToolTipText(const WebString&, WebTextDirection hint) { }
     87
    8488    // Called to get the position of the resizer rect in window coordinates.
    8589    virtual WebRect windowResizerRect() { return WebRect(); }
  • trunk/Source/WebKit/chromium/src/ExternalPopupMenu.cpp

    r78193 r88021  
    134134        WebMenuItemInfo& popupItem = items[i];
    135135        popupItem.label = m_popupMenuClient->itemText(i);
     136        popupItem.toolTip = m_popupMenuClient->itemToolTip(i);
    136137        if (m_popupMenuClient->itemIsSeparator(i))
    137138            popupItem.type = WebMenuItemInfo::Separator;
  • trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp

    r87417 r88021  
    4141#include "PlatformMouseEvent.h"
    4242#include "PlatformWheelEvent.h"
     43#include "PopupMenuChromium.h"
    4344#include "SkiaUtils.h"
    4445
     
    4748#include "WebRange.h"
    4849#include "WebRect.h"
     50#include "WebViewClient.h"
    4951#include "WebWidgetClient.h"
    5052
     
    9698        m_lastMousePosition = WebPoint(event.x, event.y);
    9799        m_widget->handleMouseMoveEvent(PlatformMouseEventBuilder(m_widget, event));
     100
     101        // We cannot call setToolTipText() in PopupContainer, because PopupContainer is in WebCore, and we cannot refer to WebKit from Webcore.
     102        WebCore::PopupContainer* container = static_cast<WebCore::PopupContainer*>(m_widget);
     103        client()->setToolTipText(container->getSelectedItemToolTip(), container->menuStyle().textDirection() == WebCore::RTL ? WebTextDirectionRightToLeft : WebTextDirectionLeftToRight);
    98104    }
    99105}
Note: See TracChangeset for help on using the changeset viewer.