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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
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 #include "chrome/browser/extensions/extension_commands_global_registry.h" 5 #include "chrome/browser/extensions/extension_commands_global_registry.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/extensions/api/commands/command_service.h" 8 #include "chrome/browser/extensions/api/commands/command_service.h"
9 #include "chrome/browser/extensions/global_shortcut_listener.h" 9 #include "chrome/browser/extensions/global_shortcut_listener.h"
10 #include "extensions/common/extension.h" 10 #include "extensions/common/extension.h"
(...skipping 17 matching lines...) Expand all
28 28
29 // Resume GlobalShortcutListener before we clean up if the shortcut handling 29 // Resume GlobalShortcutListener before we clean up if the shortcut handling
30 // is currently suspended. 30 // is currently suspended.
31 if (global_shortcut_listener->IsShortcutHandlingSuspended()) 31 if (global_shortcut_listener->IsShortcutHandlingSuspended())
32 global_shortcut_listener->SetShortcutHandlingSuspended(false); 32 global_shortcut_listener->SetShortcutHandlingSuspended(false);
33 33
34 global_shortcut_listener->UnregisterAccelerators(this); 34 global_shortcut_listener->UnregisterAccelerators(this);
35 } 35 }
36 } 36 }
37 37
38 static base::LazyInstance< 38 static base::LazyInstance<BrowserContextKeyedAPIFactory<
39 BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry> > g_factory = 39 ExtensionCommandsGlobalRegistry>>::DestructorAtExit g_factory =
40 LAZY_INSTANCE_INITIALIZER; 40 LAZY_INSTANCE_INITIALIZER;
41 41
42 // static 42 // static
43 BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>* 43 BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>*
44 ExtensionCommandsGlobalRegistry::GetFactoryInstance() { 44 ExtensionCommandsGlobalRegistry::GetFactoryInstance() {
45 return g_factory.Pointer(); 45 return g_factory.Pointer();
46 } 46 }
47 47
48 // static 48 // static
49 ExtensionCommandsGlobalRegistry* ExtensionCommandsGlobalRegistry::Get( 49 ExtensionCommandsGlobalRegistry* ExtensionCommandsGlobalRegistry::Get(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (registry_for_active_window()) 107 if (registry_for_active_window())
108 registry_for_active_window()->SetShortcutHandlingSuspended(suspended); 108 registry_for_active_window()->SetShortcutHandlingSuspended(suspended);
109 } 109 }
110 110
111 void ExtensionCommandsGlobalRegistry::OnKeyPressed( 111 void ExtensionCommandsGlobalRegistry::OnKeyPressed(
112 const ui::Accelerator& accelerator) { 112 const ui::Accelerator& accelerator) {
113 ExtensionKeybindingRegistry::NotifyEventTargets(accelerator); 113 ExtensionKeybindingRegistry::NotifyEventTargets(accelerator);
114 } 114 }
115 115
116 } // namespace extensions 116 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_extensions_browser_client.h ('k') | chrome/browser/extensions/extension_gcm_app_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698