Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1755)

Unified Diff: chrome/browser/views/toolbar_view.cc

Issue 197031: Fleshes out the tooltip implementation for views on Gtk. It doesn't... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.cc ('k') | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/toolbar_view.cc
===================================================================
--- chrome/browser/views/toolbar_view.cc (revision 25502)
+++ chrome/browser/views/toolbar_view.cc (working copy)
@@ -12,6 +12,7 @@
#include "app/os_exchange_data.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
+#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -46,9 +47,9 @@
#include "views/background.h"
#include "views/controls/button/button_dropdown.h"
#include "views/controls/label.h"
+#include "views/widget/tooltip_manager.h"
#if defined(OS_WIN)
#include "views/drag_utils.h"
-#include "views/widget/tooltip_manager.h"
#endif
#include "views/window/non_client_view.h"
#include "views/window/window.h"
@@ -584,7 +585,6 @@
}
void ToolbarView::DidGainFocus() {
-#if defined(OS_WIN)
// Check to see if MSAA focus should be restored to previously focused button,
// and if button is an enabled, visibled child of toolbar.
if (!acc_focused_view_ ||
@@ -616,6 +616,7 @@
view_index = acc_focused_view_->GetID();
}
+#if defined(OS_WIN)
gfx::NativeView wnd = GetWidget()->GetNativeView();
// Notify Access Technology that there was a change in keyboard focus.
@@ -628,7 +629,6 @@
}
void ToolbarView::WillLoseFocus() {
-#if defined(OS_WIN)
if (acc_focused_view_) {
// Resetting focus state.
acc_focused_view_->SetHotTracked(false);
@@ -636,14 +636,9 @@
// Any tooltips that are active should be hidden when toolbar loses focus.
if (GetWidget() && GetWidget()->GetTooltipManager())
GetWidget()->GetTooltipManager()->HideKeyboardTooltip();
-#else
- // TODO(port): deal with toolbar a11y focus.
- NOTIMPLEMENTED();
-#endif
}
bool ToolbarView::OnKeyPressed(const views::KeyEvent& e) {
-#if defined(OS_WIN)
// Paranoia check, button should be initialized upon toolbar gaining focus.
if (!acc_focused_view_)
return false;
@@ -652,15 +647,15 @@
int next_view = focused_view;
switch (e.GetCharacter()) {
- case VK_LEFT:
+ case base::VKEY_LEFT:
next_view = GetNextAccessibleViewIndex(focused_view, true);
break;
- case VK_RIGHT:
+ case base::VKEY_RIGHT:
next_view = GetNextAccessibleViewIndex(focused_view, false);
break;
- case VK_DOWN:
- case VK_RETURN:
- // VK_SPACE is already handled by the default case.
+ case base::VKEY_DOWN:
+ case base::VKEY_RETURN:
+ // VKEY_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,
@@ -697,24 +692,23 @@
// Hot-track new focused button.
acc_focused_view_->SetHotTracked(true);
- // Retrieve information to generate an MSAA focus event.
- int view_id = acc_focused_view_->GetID();
- gfx::NativeView wnd = GetWidget()->GetNativeView();
-
// Show the tooltip for the view that got the focus.
if (GetWidget()->GetTooltipManager()) {
GetWidget()->GetTooltipManager()->
ShowKeyboardTooltip(GetChildViewAt(next_view));
}
+#if defined(OS_WIN)
+ // Retrieve information to generate an MSAA focus event.
+ gfx::NativeView wnd = GetWidget()->GetNativeView();
+ int view_id = acc_focused_view_->GetID();
// Notify Access Technology that there was a change in keyboard focus.
::NotifyWinEvent(EVENT_OBJECT_FOCUS, wnd, OBJID_CLIENT,
static_cast<LONG>(view_id));
- return true;
- }
#else
- // TODO(port): deal with toolbar a11y focus.
- NOTIMPLEMENTED();
+ NOTIMPLEMENTED();
#endif
+ return true;
+ }
return false;
}
« no previous file with comments | « chrome/browser/views/bookmark_bar_view.cc ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698