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 | 7 |
8 #include <map> | |
9 #include <string> | 8 #include <string> |
10 | 9 |
11 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
12 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 11 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
13 #include "ui/base/accelerators/accelerator.h" | 12 #include "ui/base/accelerators/accelerator.h" |
14 | 13 |
15 class Profile; | 14 class Profile; |
16 | 15 |
17 namespace extensions { | 16 namespace extensions { |
18 class Extension; | 17 class Extension; |
(...skipping 21 matching lines...) Expand all Loading... |
40 | 39 |
41 // Overridden from ui::AcceleratorTarget. | 40 // Overridden from ui::AcceleratorTarget. |
42 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 41 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
43 virtual bool CanHandleAccelerators() const OVERRIDE; | 42 virtual bool CanHandleAccelerators() const OVERRIDE; |
44 | 43 |
45 private: | 44 private: |
46 // Overridden from ExtensionKeybindingRegistry: | 45 // Overridden from ExtensionKeybindingRegistry: |
47 virtual void AddExtensionKeybinding( | 46 virtual void AddExtensionKeybinding( |
48 const extensions::Extension* extension, | 47 const extensions::Extension* extension, |
49 const std::string& command_name) OVERRIDE; | 48 const std::string& command_name) OVERRIDE; |
50 virtual void RemoveExtensionKeybinding( | 49 virtual void RemoveExtensionKeybindingImpl( |
51 const extensions::Extension* extension, | 50 const ui::Accelerator& accelerator, |
52 const std::string& command_name) OVERRIDE; | 51 const std::string& command_name) OVERRIDE; |
53 | 52 |
54 // Weak pointer to the our profile. Not owned by us. | 53 // Weak pointer to the our profile. Not owned by us. |
55 Profile* profile_; | 54 Profile* profile_; |
56 | 55 |
57 // 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 |
58 // accelerators with. Not owned by us. | 57 // accelerators with. Not owned by us. |
59 views::FocusManager* focus_manager_; | 58 views::FocusManager* focus_manager_; |
60 | 59 |
61 // Maps an accelerator to a string pair (extension id, command name) for | |
62 // commands that have been registered. Unlike its GTK counterpart, this map | |
63 // contains no registration for pageAction and browserAction commands. | |
64 typedef std::map< ui::Accelerator, | |
65 std::pair<std::string, std::string> > EventTargets; | |
66 EventTargets event_targets_; | |
67 | |
68 // The content notification registrar for listening to extension events. | 60 // The content notification registrar for listening to extension events. |
69 content::NotificationRegistrar registrar_; | 61 content::NotificationRegistrar registrar_; |
70 | 62 |
71 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryViews); | 63 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryViews); |
72 }; | 64 }; |
73 | 65 |
74 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEW
S_H_ | 66 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_VIEW
S_H_ |
OLD | NEW |