OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |