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

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

Issue 140613002: Cleanup: Replace &LazyInstance::Get() with LazyInstance::Pointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 } 29 }
30 30
31 static base::LazyInstance< 31 static base::LazyInstance<
32 ProfileKeyedAPIFactory<ExtensionCommandsGlobalRegistry> > 32 ProfileKeyedAPIFactory<ExtensionCommandsGlobalRegistry> >
33 g_factory = LAZY_INSTANCE_INITIALIZER; 33 g_factory = LAZY_INSTANCE_INITIALIZER;
34 34
35 // static 35 // static
36 ProfileKeyedAPIFactory<ExtensionCommandsGlobalRegistry>* 36 ProfileKeyedAPIFactory<ExtensionCommandsGlobalRegistry>*
37 ExtensionCommandsGlobalRegistry::GetFactoryInstance() { 37 ExtensionCommandsGlobalRegistry::GetFactoryInstance() {
38 return &g_factory.Get(); 38 return g_factory.Pointer();
39 } 39 }
40 40
41 // static 41 // static
42 ExtensionCommandsGlobalRegistry* 42 ExtensionCommandsGlobalRegistry*
43 ExtensionCommandsGlobalRegistry::Get(Profile* profile) { 43 ExtensionCommandsGlobalRegistry::Get(Profile* profile) {
44 return ProfileKeyedAPIFactory< 44 return ProfileKeyedAPIFactory<
45 ExtensionCommandsGlobalRegistry>::GetForProfile(profile); 45 ExtensionCommandsGlobalRegistry>::GetForProfile(profile);
46 } 46 }
47 47
48 void ExtensionCommandsGlobalRegistry::AddExtensionKeybinding( 48 void ExtensionCommandsGlobalRegistry::AddExtensionKeybinding(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 GlobalShortcutListener::GetInstance()->UnregisterAccelerator( 96 GlobalShortcutListener::GetInstance()->UnregisterAccelerator(
97 accelerator, this); 97 accelerator, this);
98 } 98 }
99 99
100 void ExtensionCommandsGlobalRegistry::OnKeyPressed( 100 void ExtensionCommandsGlobalRegistry::OnKeyPressed(
101 const ui::Accelerator& accelerator) { 101 const ui::Accelerator& accelerator) {
102 ExtensionKeybindingRegistry::NotifyEventTargets(accelerator); 102 ExtensionKeybindingRegistry::NotifyEventTargets(accelerator);
103 } 103 }
104 104
105 } // namespace extensions 105 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698