| OLD | NEW |
| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // ExtensionKeybindingRegistry class that handles turning keyboard shortcuts | 26 // ExtensionKeybindingRegistry class that handles turning keyboard shortcuts |
| 27 // into events that get sent to the extension. | 27 // into events that get sent to the extension. |
| 28 | 28 |
| 29 // ExtensionKeybindingRegistryCocoa is a class that handles Cocoa-specific | 29 // ExtensionKeybindingRegistryCocoa is a class that handles Cocoa-specific |
| 30 // implemenation of the Extension Commands shortcuts (keyboard accelerators). | 30 // implemenation of the Extension Commands shortcuts (keyboard accelerators). |
| 31 // It also routes the events to the intended recipient (ie. to the browser | 31 // It also routes the events to the intended recipient (ie. to the browser |
| 32 // action button in case of browser action commands). | 32 // action button in case of browser action commands). |
| 33 class ExtensionKeybindingRegistryCocoa | 33 class ExtensionKeybindingRegistryCocoa |
| 34 : public extensions::ExtensionKeybindingRegistry { | 34 : public extensions::ExtensionKeybindingRegistry { |
| 35 public: | 35 public: |
| 36 ExtensionKeybindingRegistryCocoa(Profile* profile, gfx::NativeWindow window); | 36 ExtensionKeybindingRegistryCocoa(Profile* profile, |
| 37 gfx::NativeWindow window, |
| 38 ExtensionFilter extension_filter); |
| 37 virtual ~ExtensionKeybindingRegistryCocoa(); | 39 virtual ~ExtensionKeybindingRegistryCocoa(); |
| 38 | 40 |
| 39 static void set_shortcut_handling_suspended(bool suspended) { | 41 static void set_shortcut_handling_suspended(bool suspended) { |
| 40 shortcut_handling_suspended_ = suspended; | 42 shortcut_handling_suspended_ = suspended; |
| 41 } | 43 } |
| 42 static bool shortcut_handling_suspended() { | 44 static bool shortcut_handling_suspended() { |
| 43 return shortcut_handling_suspended_; | 45 return shortcut_handling_suspended_; |
| 44 } | 46 } |
| 45 | 47 |
| 46 // For a given keyboard |event|, see if a known Extension Command registration | 48 // For a given keyboard |event|, see if a known Extension Command registration |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 std::pair<std::string, std::string> > EventTargets; | 81 std::pair<std::string, std::string> > EventTargets; |
| 80 EventTargets event_targets_; | 82 EventTargets event_targets_; |
| 81 | 83 |
| 82 // The content notification registrar for listening to extension events. | 84 // The content notification registrar for listening to extension events. |
| 83 content::NotificationRegistrar registrar_; | 85 content::NotificationRegistrar registrar_; |
| 84 | 86 |
| 85 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryCocoa); | 87 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryCocoa); |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCO
A_H_ | 90 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_COCO
A_H_ |
| OLD | NEW |