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

Side by Side Diff: chrome/browser/extensions/api/commands/command_service.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) 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 #include "chrome/browser/extensions/api/commands/command_service.h" 5 #include "chrome/browser/extensions/api/commands/command_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 CommandService::~CommandService() { 122 CommandService::~CommandService() {
123 } 123 }
124 124
125 static base::LazyInstance<ProfileKeyedAPIFactory<CommandService> > 125 static base::LazyInstance<ProfileKeyedAPIFactory<CommandService> >
126 g_factory = LAZY_INSTANCE_INITIALIZER; 126 g_factory = LAZY_INSTANCE_INITIALIZER;
127 127
128 // static 128 // static
129 ProfileKeyedAPIFactory<CommandService>* CommandService::GetFactoryInstance() { 129 ProfileKeyedAPIFactory<CommandService>* CommandService::GetFactoryInstance() {
130 return &g_factory.Get(); 130 return g_factory.Pointer();
131 } 131 }
132 132
133 // static 133 // static
134 CommandService* CommandService::Get(Profile* profile) { 134 CommandService* CommandService::Get(Profile* profile) {
135 return ProfileKeyedAPIFactory<CommandService>::GetForProfile(profile); 135 return ProfileKeyedAPIFactory<CommandService>::GetForProfile(profile);
136 } 136 }
137 137
138 // static 138 // static
139 bool CommandService::IsMediaKey(const ui::Accelerator& accelerator) { 139 bool CommandService::IsMediaKey(const ui::Accelerator& accelerator) {
140 if (accelerator.modifiers() != 0) 140 if (accelerator.modifiers() != 0)
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 return true; 525 return true;
526 } 526 }
527 527
528 template <> 528 template <>
529 void ProfileKeyedAPIFactory<CommandService>::DeclareFactoryDependencies() { 529 void ProfileKeyedAPIFactory<CommandService>::DeclareFactoryDependencies() {
530 DependsOn(ExtensionCommandsGlobalRegistry::GetFactoryInstance()); 530 DependsOn(ExtensionCommandsGlobalRegistry::GetFactoryInstance());
531 } 531 }
532 532
533 } // namespace extensions 533 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/cast_channel/cast_socket.cc ('k') | chrome/browser/extensions/api/cookies/cookies_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698