| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/toolbar/toolbar_actions_model_factory.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_actions_model_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 7 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 9 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 11 #include "extensions/browser/extension_prefs.h" | 11 #include "extensions/browser/extension_prefs.h" |
| 12 #include "extensions/browser/extension_prefs_factory.h" | 12 #include "extensions/browser/extension_prefs_factory.h" |
| 13 #include "extensions/browser/extensions_browser_client.h" | 13 #include "extensions/browser/extensions_browser_client.h" |
| 14 | 14 |
| 15 // static | 15 // static |
| 16 ToolbarActionsModel* ToolbarActionsModelFactory::GetForProfile( | 16 ToolbarActionsModel* ToolbarActionsModelFactory::GetForProfile( |
| 17 Profile* profile) { | 17 Profile* profile) { |
| 18 return static_cast<ToolbarActionsModel*>( | 18 return static_cast<ToolbarActionsModel*>( |
| 19 GetInstance()->GetServiceForBrowserContext(profile, true)); | 19 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 20 } | 20 } |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 ToolbarActionsModelFactory* ToolbarActionsModelFactory::GetInstance() { | 23 ToolbarActionsModelFactory* ToolbarActionsModelFactory::GetInstance() { |
| 24 return Singleton<ToolbarActionsModelFactory>::get(); | 24 return base::Singleton<ToolbarActionsModelFactory>::get(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 ToolbarActionsModelFactory::ToolbarActionsModelFactory() | 27 ToolbarActionsModelFactory::ToolbarActionsModelFactory() |
| 28 : BrowserContextKeyedServiceFactory( | 28 : BrowserContextKeyedServiceFactory( |
| 29 "ToolbarActionsModel", | 29 "ToolbarActionsModel", |
| 30 BrowserContextDependencyManager::GetInstance()) { | 30 BrowserContextDependencyManager::GetInstance()) { |
| 31 DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); | 31 DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); |
| 32 DependsOn(extensions::ExtensionActionAPI::GetFactoryInstance()); | 32 DependsOn(extensions::ExtensionActionAPI::GetFactoryInstance()); |
| 33 } | 33 } |
| 34 | 34 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 46 return context; | 46 return context; |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool ToolbarActionsModelFactory::ServiceIsCreatedWithBrowserContext() const { | 49 bool ToolbarActionsModelFactory::ServiceIsCreatedWithBrowserContext() const { |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool ToolbarActionsModelFactory::ServiceIsNULLWhileTesting() const { | 53 bool ToolbarActionsModelFactory::ServiceIsNULLWhileTesting() const { |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| OLD | NEW |