From 0e6fe1d195b5a320676db56c74f1e46a102bd8e3 Mon Sep 17 00:00:00 2001 From: "rogerta@chromium.org" Date: Tue, 26 Nov 2013 20:52:14 +0000 Subject: Revert of https://codereview.chromium.org/62763003/ Reason for revert: This CL broke interactive tests on mac: http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.6%20Tests%20%281%29&number=46945 TBR=koz@chromium.org,mlamouri@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/89183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237404 0039d316-1c4b-4281-b951-d872f2087c98 --- apps/shell_window.cc | 30 ------------------------------ apps/shell_window.h | 4 ---- 2 files changed, 34 deletions(-) (limited to 'apps') diff --git a/apps/shell_window.cc b/apps/shell_window.cc index 7d1f1a9..aade475 100644 --- a/apps/shell_window.cc +++ b/apps/shell_window.cc @@ -289,39 +289,9 @@ void ShellWindow::AddNewContents(WebContents* source, initial_pos, user_gesture, was_blocked); } -bool ShellWindow::PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event, - bool* is_keyboard_shortcut) { - // Here, we can handle a key event before the content gets it. When we are - // fullscreen, we want to allow the user to leave when ESC is pressed. - // However, if the application has the "overrideEscFullscreen" permission, we - // should let it override that behavior. - // ::HandleKeyboardEvent() will only be called if the KeyEvent's default - // action is not prevented. - // Thus, we should handle the KeyEvent here only if the permission is not set. - if (event.windowsKeyCode == ui::VKEY_ESCAPE && - (fullscreen_types_ != FULLSCREEN_TYPE_NONE) && - !extension_->HasAPIPermission(APIPermission::kOverrideEscFullscreen)) { - Restore(); - return true; - } - - return false; -} - void ShellWindow::HandleKeyboardEvent( WebContents* source, const content::NativeWebKeyboardEvent& event) { - // If the window is currently fullscreen, ESC should leave fullscreen. - // If this code is being called for ESC, that means that the KeyEvent's - // default behavior was not prevented by the content. - if (event.windowsKeyCode == ui::VKEY_ESCAPE && - (fullscreen_types_ != FULLSCREEN_TYPE_NONE)) { - Restore(); - return; - } - native_app_window_->HandleKeyboardEvent(event); } diff --git a/apps/shell_window.h b/apps/shell_window.h index 9d21c4e..d8d3964 100644 --- a/apps/shell_window.h +++ b/apps/shell_window.h @@ -375,10 +375,6 @@ class ShellWindow : public content::NotificationObserver, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) OVERRIDE; - virtual bool PreHandleKeyboardEvent( - content::WebContents* source, - const content::NativeWebKeyboardEvent& event, - bool* is_keyboard_shortcut) OVERRIDE; virtual void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) OVERRIDE; -- cgit v1.1