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

Unified Diff: chrome/browser/extensions/extension_view_host.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
Index: chrome/browser/extensions/extension_view_host.cc
diff --git a/chrome/browser/extensions/extension_view_host.cc b/chrome/browser/extensions/extension_view_host.cc
index 5b5d9d4e47da9c99a83769f2a12b7ea617bc5afe..112f79a44f8f227400675aec993f9219a8c6d6bd 100644
--- a/chrome/browser/extensions/extension_view_host.cc
+++ b/chrome/browser/extensions/extension_view_host.cc
@@ -18,6 +18,7 @@
#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
+#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
@@ -173,25 +174,21 @@ bool ExtensionViewHost::ShouldTransferNavigation(
return !is_main_frame_navigation;
}
-bool ExtensionViewHost::PreHandleKeyboardEvent(
- WebContents* source,
- const NativeWebKeyboardEvent& event,
- bool* is_keyboard_shortcut) {
+content::KeyboardEventProcessingResult
+ExtensionViewHost::PreHandleKeyboardEvent(WebContents* source,
+ const NativeWebKeyboardEvent& event) {
if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP &&
event.type() == NativeWebKeyboardEvent::RawKeyDown &&
event.windowsKeyCode == ui::VKEY_ESCAPE) {
- DCHECK(is_keyboard_shortcut != NULL);
- *is_keyboard_shortcut = true;
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED_IS_SHORTCUT;
}
// Handle higher priority browser shortcuts such as Ctrl-w.
Browser* browser = view_->GetBrowser();
if (browser)
- return browser->PreHandleKeyboardEvent(source, event, is_keyboard_shortcut);
+ return browser->PreHandleKeyboardEvent(source, event);
- *is_keyboard_shortcut = false;
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED;
}
void ExtensionViewHost::HandleKeyboardEvent(
« no previous file with comments | « chrome/browser/extensions/extension_view_host.h ('k') | chrome/browser/extensions/global_shortcut_listener_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698