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

Unified Diff: extensions/browser/app_window/app_window.cc

Issue 2775553002: Adds the ability for WebContentsDelegate to decide if event should be updated (Closed)
Patch Set: Fix compile Created 3 years, 9 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 | « extensions/browser/app_window/app_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/app_window/app_window.cc
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc
index 69126c3436afac97b927ac5384ec584ea7f58413..6d52ad22e934d4cd93892d50f5f57a97cc8d0a75 100644
--- a/extensions/browser/app_window/app_window.cc
+++ b/extensions/browser/app_window/app_window.cc
@@ -22,6 +22,7 @@
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/invalidate_type.h"
+#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
@@ -379,13 +380,12 @@ void AppWindow::AddNewContents(WebContents* source,
was_blocked);
}
-bool AppWindow::PreHandleKeyboardEvent(
+content::KeyboardEventProcessingResult AppWindow::PreHandleKeyboardEvent(
content::WebContents* source,
- const content::NativeWebKeyboardEvent& event,
- bool* is_keyboard_shortcut) {
+ const content::NativeWebKeyboardEvent& event) {
const Extension* extension = GetExtension();
if (!extension)
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED;
// Here, we can handle a key event before the content gets it. When we are
// fullscreen and it is not forced, we want to allow the user to leave
@@ -400,10 +400,10 @@ bool AppWindow::PreHandleKeyboardEvent(
!extension->permissions_data()->HasAPIPermission(
APIPermission::kOverrideEscFullscreen)) {
Restore();
- return true;
+ return content::KeyboardEventProcessingResult::HANDLED;
}
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED;
}
void AppWindow::HandleKeyboardEvent(
« no previous file with comments | « extensions/browser/app_window/app_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698