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

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

Issue 883553002: A better fix for crash when opening Incognito window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ValidationMessageBubble
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_COMMANDS_GLOBAL_REGISTRY_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // window or on the global registry. 58 // window or on the global registry.
59 bool IsRegistered(const ui::Accelerator& accelerator); 59 bool IsRegistered(const ui::Accelerator& accelerator);
60 60
61 private: 61 private:
62 friend class BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>; 62 friend class BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>;
63 63
64 // BrowserContextKeyedAPI implementation. 64 // BrowserContextKeyedAPI implementation.
65 static const char* service_name() { 65 static const char* service_name() {
66 return "ExtensionCommandsGlobalRegistry"; 66 return "ExtensionCommandsGlobalRegistry";
67 } 67 }
68 static const bool kServiceRedirectedInIncognito = true;
68 69
69 // Overridden from ExtensionKeybindingRegistry: 70 // Overridden from ExtensionKeybindingRegistry:
70 void AddExtensionKeybindings(const Extension* extension, 71 void AddExtensionKeybindings(const Extension* extension,
71 const std::string& command_name) override; 72 const std::string& command_name) override;
72 void RemoveExtensionKeybindingImpl(const ui::Accelerator& accelerator, 73 void RemoveExtensionKeybindingImpl(const ui::Accelerator& accelerator,
73 const std::string& command_name) override; 74 const std::string& command_name) override;
74 void OnShortcutHandlingSuspended(bool suspended) override; 75 void OnShortcutHandlingSuspended(bool suspended) override;
75 76
76 // Called by the GlobalShortcutListener object when a shortcut this class has 77 // Called by the GlobalShortcutListener object when a shortcut this class has
77 // registered for has been pressed. 78 // registered for has been pressed.
78 void OnKeyPressed(const ui::Accelerator& accelerator) override; 79 void OnKeyPressed(const ui::Accelerator& accelerator) override;
79 80
80 // Weak pointer to our browser context. Not owned by us. 81 // Weak pointer to our browser context. Not owned by us.
81 content::BrowserContext* browser_context_; 82 content::BrowserContext* browser_context_;
82 83
83 // The global commands registry not only keeps track of global commands 84 // The global commands registry not only keeps track of global commands
84 // registered, but also of which non-global command registry is active 85 // registered, but also of which non-global command registry is active
85 // (belonging to the currently active window). Only valid for TOOLKIT_VIEWS 86 // (belonging to the currently active window). Only valid for TOOLKIT_VIEWS
86 // and 87 // and
87 // NULL otherwise. 88 // NULL otherwise.
88 ExtensionKeybindingRegistry* registry_for_active_window_; 89 ExtensionKeybindingRegistry* registry_for_active_window_;
89 90
90 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsGlobalRegistry); 91 DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsGlobalRegistry);
91 }; 92 };
92 93
93 } // namespace extensions 94 } // namespace extensions
94 95
95 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_ 96 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COMMANDS_GLOBAL_REGISTRY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698