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

Unified Diff: chrome/browser/ui/browser.cc

Issue 10459044: Fix inconsistency in browser shortcut handling when a BrowserAction popup is focused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix, rebase Created 8 years, 6 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/ui/browser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index d4ee67f0084151da38e71cacfca9580626a641cf..d0422d8185a16d2fc779309d74c415c1f8b021ea 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -3041,6 +3041,21 @@ void Browser::TabStripEmpty() {
is_attempting_to_close_browser_ = true;
}
+bool Browser::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut) {
+ // Escape exits tabbed fullscreen mode.
+ // TODO(koz): Write a test for this http://crbug.com/100441.
+ if (event.windowsKeyCode == 27 &&
+ fullscreen_controller_->HandleUserPressedEscape()) {
+ return true;
+ }
+ return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut);
+}
+
+void Browser::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
+ window()->HandleKeyboardEvent(event);
+}
+
void Browser::OnAcceptFullscreenPermission(
const GURL& url,
FullscreenExitBubbleType bubble_type) {
@@ -3458,21 +3473,6 @@ void Browser::ViewSourceForFrame(WebContents* source,
ViewSource(tab_contents, frame_url, frame_content_state);
}
-bool Browser::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
- bool* is_keyboard_shortcut) {
- // Escape exits tabbed fullscreen mode.
- // TODO(koz): Write a test for this http://crbug.com/100441.
- if (event.windowsKeyCode == 27 &&
- fullscreen_controller_->HandleUserPressedEscape()) {
- return true;
- }
- return window()->PreHandleKeyboardEvent(event, is_keyboard_shortcut);
-}
-
-void Browser::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
- window()->HandleKeyboardEvent(event);
-}
-
void Browser::ShowRepostFormWarningDialog(WebContents* source) {
browser::ShowTabModalConfirmDialog(
new RepostFormWarningController(source),
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698