summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/toolbar_view.cc
diff options
context:
space:
mode:
authormhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 03:34:48 +0000
committermhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 03:34:48 +0000
commit4b6f2bd72042ee5906e5050432fd6059d86358c4 (patch)
tree19d250985be95dc3d0cdd5e63865d747125cc9b3 /chrome/browser/views/toolbar_view.cc
parenteabecbe43e7f5f238503383d481a01d39e4380cf (diff)
downloadchromium_src-4b6f2bd72042ee5906e5050432fd6059d86358c4.zip
chromium_src-4b6f2bd72042ee5906e5050432fd6059d86358c4.tar.gz
chromium_src-4b6f2bd72042ee5906e5050432fd6059d86358c4.tar.bz2
Fix flashing issue when hitting escape while find bar is active.
When the View try's to focus to the last focused component, it can't, because ToolBarView is not Focusable, hence overriding IsFocusable will fix the flashing, but will create a focusable ring around the whole toolbar. BUG=15228 TEST=ALT+SHIFT+T press left arrow until page menu, and select find in page. Press ESC numerous times, no more flashing issues for the find bar. Review URL: http://codereview.chromium.org/265056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/toolbar_view.cc')
-rw-r--r--chrome/browser/views/toolbar_view.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 8021553..1cdc877 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -648,6 +648,20 @@ void ToolbarView::WillLoseFocus() {
GetWidget()->GetTooltipManager()->HideKeyboardTooltip();
}
+void ToolbarView::RequestFocus() {
+ // When the toolbar needs to request focus, the default implementation of
+ // View::RequestFocus requires the View to be focusable. Since ToolbarView is
+ // not technically focused, we need to temporarily set and remove focus so
+ // that it can focus back to its MSAA focused state.
+ if (acc_focused_view_) {
+ SetFocusable(true);
+ View::RequestFocus();
+ SetFocusable(false);
+ } else {
+ View::RequestFocus();
+ }
+}
+
bool ToolbarView::OnKeyPressed(const views::KeyEvent& e) {
// Paranoia check, button should be initialized upon toolbar gaining focus.
if (!acc_focused_view_)