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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.h

Issue 388313002: mac: Allow WebContents key handling to supplant extension overrides of the bookmark shortcut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from yoz and shess. Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCOA_H _ 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCOA_H _
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCOA_H _ 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCOA_H _
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "chrome/browser/extensions/extension_keybinding_registry.h" 11 #include "chrome/browser/extensions/extension_keybinding_registry.h"
12 #include "ui/base/accelerators/accelerator.h" 12 #include "ui/base/accelerators/accelerator.h"
13 #include "ui/base/accelerators/accelerator_manager.h"
13 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
14 15
15 class Profile; 16 class Profile;
16 17
17 namespace content { 18 namespace content {
18 struct NativeWebKeyboardEvent; 19 struct NativeWebKeyboardEvent;
19 } 20 }
20 namespace extensions { 21 namespace extensions {
21 class Extension; 22 class Extension;
22 } 23 }
(...skipping 18 matching lines...) Expand all
41 static void set_shortcut_handling_suspended(bool suspended) { 42 static void set_shortcut_handling_suspended(bool suspended) {
42 shortcut_handling_suspended_ = suspended; 43 shortcut_handling_suspended_ = suspended;
43 } 44 }
44 static bool shortcut_handling_suspended() { 45 static bool shortcut_handling_suspended() {
45 return shortcut_handling_suspended_; 46 return shortcut_handling_suspended_;
46 } 47 }
47 48
48 // For a given keyboard |event|, see if a known Extension Command registration 49 // For a given keyboard |event|, see if a known Extension Command registration
49 // exists and route the event to it. Returns true if the event was handled, 50 // exists and route the event to it. Returns true if the event was handled,
50 // false otherwise. 51 // false otherwise.
51 bool ProcessKeyEvent(const content::NativeWebKeyboardEvent& event); 52 bool ProcessKeyEvent(const content::NativeWebKeyboardEvent& event,
53 ui::AcceleratorManager::HandlerPriority priority);
52 54
53 protected: 55 protected:
54 // Overridden from ExtensionKeybindingRegistry: 56 // Overridden from ExtensionKeybindingRegistry:
55 virtual void AddExtensionKeybinding( 57 virtual void AddExtensionKeybinding(
56 const extensions::Extension* extension, 58 const extensions::Extension* extension,
57 const std::string& command_name) OVERRIDE; 59 const std::string& command_name) OVERRIDE;
58 virtual void RemoveExtensionKeybindingImpl( 60 virtual void RemoveExtensionKeybindingImpl(
59 const ui::Accelerator& accelerator, 61 const ui::Accelerator& accelerator,
60 const std::string& command_name) OVERRIDE; 62 const std::string& command_name) OVERRIDE;
61 63
(...skipping 11 matching lines...) Expand all
73 // The window we are associated with. 75 // The window we are associated with.
74 gfx::NativeWindow window_; 76 gfx::NativeWindow window_;
75 77
76 // The content notification registrar for listening to extension events. 78 // The content notification registrar for listening to extension events.
77 content::NotificationRegistrar registrar_; 79 content::NotificationRegistrar registrar_;
78 80
79 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryCocoa); 81 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryCocoa);
80 }; 82 };
81 83
82 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCO A_H_ 84 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCO A_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698