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