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

Side by Side Diff: chrome/browser/extensions/extension_keybinding_registry.h

Issue 10701005: Extension Commands changed by the user now take effect immediately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
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_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 20 matching lines...) Expand all
31 // Enables/Disables general shortcut handing in Chrome. Implemented in 31 // Enables/Disables general shortcut handing in Chrome. Implemented in
32 // platform-specific ExtensionKeybindingsRegistry* files. 32 // platform-specific ExtensionKeybindingsRegistry* files.
33 static void SetShortcutHandlingSuspended(bool suspended); 33 static void SetShortcutHandlingSuspended(bool suspended);
34 34
35 // Overridden from content::NotificationObserver: 35 // Overridden from content::NotificationObserver:
36 virtual void Observe(int type, 36 virtual void Observe(int type,
37 const content::NotificationSource& source, 37 const content::NotificationSource& source,
38 const content::NotificationDetails& details) OVERRIDE; 38 const content::NotificationDetails& details) OVERRIDE;
39 39
40 protected: 40 protected:
41 // Add extension keybinding for the events defined by the |extension|. 41 // Add extension keybinding for the events defined by the |extension|.
Yoyo Zhou 2012/06/28 22:40:51 Comments need to be updated.
Finnur 2012/06/28 22:49:01 Ah, right! On 2012/06/28 22:40:51, Yoyo Zhou wro
42 virtual void AddExtensionKeybinding( 42 virtual void AddExtensionKeybinding(
43 const Extension* extension) = 0; 43 const Extension* extension,
44 const std::string& command_name) = 0;
44 // Remove extension bindings for |extension|. 45 // Remove extension bindings for |extension|.
45 virtual void RemoveExtensionKeybinding( 46 virtual void RemoveExtensionKeybinding(
46 const Extension* extension) = 0; 47 const Extension* extension,
48 const std::string& command_name) = 0;
47 49
48 // Make sure all extensions registered have keybindings added. 50 // Make sure all extensions registered have keybindings added.
49 void Init(); 51 void Init();
50 52
51 // Whether to ignore this command. Only browserAction commands and pageAction 53 // Whether to ignore this command. Only browserAction commands and pageAction
52 // commands are currently ignored, since they are handled elsewhere. 54 // commands are currently ignored, since they are handled elsewhere.
53 bool ShouldIgnoreCommand(const std::string& command) const; 55 bool ShouldIgnoreCommand(const std::string& command) const;
54 56
55 private: 57 private:
56 // The content notification registrar for listening to extension events. 58 // The content notification registrar for listening to extension events.
57 content::NotificationRegistrar registrar_; 59 content::NotificationRegistrar registrar_;
58 60
59 // Weak pointer to the our profile. Not owned by us. 61 // Weak pointer to the our profile. Not owned by us.
60 Profile* profile_; 62 Profile* profile_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); 64 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry);
63 }; 65 };
64 66
65 } // namespace extensions 67 } // namespace extensions
66 68
67 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ 69 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698