| 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_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEWS_H
_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEWS_H
_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEWS_H
_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEWS_H
_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 views::FocusManager* focus_manager); | 37 views::FocusManager* focus_manager); |
| 38 virtual ~ExtensionKeybindingRegistryViews(); | 38 virtual ~ExtensionKeybindingRegistryViews(); |
| 39 | 39 |
| 40 // Overridden from ui::AcceleratorTarget. | 40 // Overridden from ui::AcceleratorTarget. |
| 41 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 41 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 42 virtual bool CanHandleAccelerators() const OVERRIDE; | 42 virtual bool CanHandleAccelerators() const OVERRIDE; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 // Overridden from ExtensionKeybindingRegistry: | 45 // Overridden from ExtensionKeybindingRegistry: |
| 46 virtual void AddExtensionKeybinding( | 46 virtual void AddExtensionKeybinding( |
| 47 const extensions::Extension* extension) OVERRIDE; | 47 const extensions::Extension* extension, |
| 48 const std::string& command_name) OVERRIDE; |
| 48 virtual void RemoveExtensionKeybinding( | 49 virtual void RemoveExtensionKeybinding( |
| 49 const extensions::Extension* extension) OVERRIDE; | 50 const extensions::Extension* extension, |
| 51 const std::string& command_name) OVERRIDE; |
| 50 | 52 |
| 51 // Weak pointer to the our profile. Not owned by us. | 53 // Weak pointer to the our profile. Not owned by us. |
| 52 Profile* profile_; | 54 Profile* profile_; |
| 53 | 55 |
| 54 // Weak pointer back to the focus manager to use to register and unregister | 56 // Weak pointer back to the focus manager to use to register and unregister |
| 55 // accelerators with. Not owned by us. | 57 // accelerators with. Not owned by us. |
| 56 views::FocusManager* focus_manager_; | 58 views::FocusManager* focus_manager_; |
| 57 | 59 |
| 58 // Maps an accelerator to a string pair (extension id, command name) for | 60 // Maps an accelerator to a string pair (extension id, command name) for |
| 59 // commands that have been registered. Unlike its GTK counterpart, this map | 61 // commands that have been registered. Unlike its GTK counterpart, this map |
| 60 // contains no registration for pageAction and browserAction commands. | 62 // contains no registration for pageAction and browserAction commands. |
| 61 typedef std::map< ui::Accelerator, | 63 typedef std::map< ui::Accelerator, |
| 62 std::pair<std::string, std::string> > EventTargets; | 64 std::pair<std::string, std::string> > EventTargets; |
| 63 EventTargets event_targets_; | 65 EventTargets event_targets_; |
| 64 | 66 |
| 65 // The content notification registrar for listening to extension events. | 67 // The content notification registrar for listening to extension events. |
| 66 content::NotificationRegistrar registrar_; | 68 content::NotificationRegistrar registrar_; |
| 67 | 69 |
| 68 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryViews); | 70 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryViews); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEW
S_H_ | 73 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEW
S_H_ |
| OLD | NEW |