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

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

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 | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index f5b2d54a63ee256c270723d25ae07e86181d59cd..da581d9f00197d30ca57376c3ad4d9c1a765e52e 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -58,6 +58,7 @@
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "components/translate/core/browser/language_state.h"
+#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
@@ -694,34 +695,35 @@ void BrowserWindowCocoa::ShowAppMenu() {
// No-op. Mac doesn't support showing the menus via alt keys.
}
-bool BrowserWindowCocoa::PreHandleKeyboardEvent(
- const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
+content::KeyboardEventProcessingResult
+BrowserWindowCocoa::PreHandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event) {
// Handle ESC to dismiss permission bubbles, but still forward it
// to the window afterwards.
if (event.windowsKeyCode == ui::VKEY_ESCAPE)
[controller_ dismissPermissionBubble];
if (![BrowserWindowUtils shouldHandleKeyboardEvent:event])
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED;
if (event.type() == blink::WebInputEvent::RawKeyDown &&
[controller_
handledByExtensionCommand:event.os_event
priority:ui::AcceleratorManager::kHighPriority])
- return true;
+ return content::KeyboardEventProcessingResult::HANDLED;
int id = [BrowserWindowUtils getCommandId:event];
if (id == -1)
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED;
if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) {
- return [BrowserWindowUtils handleKeyboardEvent:event.os_event
- inWindow:window()];
+ return [BrowserWindowUtils handleKeyboardEvent:event.os_event
+ inWindow:window()]
+ ? content::KeyboardEventProcessingResult::HANDLED
+ : content::KeyboardEventProcessingResult::NOT_HANDLED;
}
- DCHECK(is_keyboard_shortcut);
- *is_keyboard_shortcut = true;
- return false;
+ return content::KeyboardEventProcessingResult::NOT_HANDLED_IS_SHORTCUT;
}
void BrowserWindowCocoa::HandleKeyboardEvent(
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698