diff options
author | stanguturi@google.com <stanguturi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 22:05:33 +0000 |
---|---|---|
committer | stanguturi@google.com <stanguturi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 22:05:33 +0000 |
commit | 8287a0b5dada39ec40fd7311b0d314cf1538bff3 (patch) | |
tree | bd19db7159534bbfc8a8f5fefa6008aa14ebded6 /chrome/browser | |
parent | a9da16d0e7aa10ad2f4ee3290edc361b862e6314 (diff) | |
download | chromium_src-8287a0b5dada39ec40fd7311b0d314cf1538bff3.zip chromium_src-8287a0b5dada39ec40fd7311b0d314cf1538bff3.tar.gz chromium_src-8287a0b5dada39ec40fd7311b0d314cf1538bff3.tar.bz2 |
Made changes to display tooltip window when user navigates through the icons in the toolbar using keyboard arrow keys.
I have already fixed this issue. (Issue:801). I have got LGTM also. But, I have checked in the code when tree was closed. So, all my changes were reverted. So, this new issue is created to upload the same changes.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 5ac0bc3..cc99296 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -60,6 +60,7 @@ #include "chrome/views/view_container.h" #include "chrome/views/background.h" #include "chrome/views/label.h" +#include "chrome/views/tooltip_manager.h" #include "net/base/net_util.h" #include "generated_resources.h" @@ -372,6 +373,9 @@ void BrowserToolbarView::DidGainFocus() { void BrowserToolbarView::WillLoseFocus() { // Resetting focus state. acc_focused_view_->SetHotTracked(false); + // Any tooltips that are active should be hidden when toolbar loses focus. + if (GetViewContainer() && GetViewContainer()->GetTooltipManager()) + GetViewContainer()->GetTooltipManager()->HideKeyboardTooltip(); acc_focused_view_ = NULL; } @@ -395,6 +399,10 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { // VK_SPACE is already handled by the default case. if (acc_focused_view_->GetID() == VIEW_ID_PAGE_MENU || acc_focused_view_->GetID() == VIEW_ID_APP_MENU) { + // If a menu button in toolbar is activated and its menu is displayed, + // then active tooltip should be hidden. + if (GetViewContainer()->GetTooltipManager()) + GetViewContainer()->GetTooltipManager()->HideKeyboardTooltip(); // Safe to cast, given to above check. static_cast<ChromeViews::MenuButton*>(acc_focused_view_)->Activate(); // Re-enable hot-tracking, as Activate() will disable it. @@ -425,6 +433,10 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { int view_id = acc_focused_view_->GetID(); HWND hwnd = GetViewContainer()->GetHWND(); + // Show the tooltip for the view that got the focus. + if (GetViewContainer()->GetTooltipManager()) + GetViewContainer()->GetTooltipManager()-> + ShowKeyboardTooltip(GetChildViewAt(next_view)); // Notify Access Technology that there was a change in keyboard focus. ::NotifyWinEvent(EVENT_OBJECT_FOCUS, hwnd, OBJID_CLIENT, static_cast<LONG>(view_id)); |