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/extensions/menu_manager_factory.h" | 5 #include "chrome/browser/extensions/menu_manager_factory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/menu_manager.h" | 7 #include "chrome/browser/extensions/menu_manager.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
10 #include "extensions/browser/extension_system.h" | 10 #include "extensions/browser/extension_system.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 "MenuManager", | 30 "MenuManager", |
31 BrowserContextDependencyManager::GetInstance()) { | 31 BrowserContextDependencyManager::GetInstance()) { |
32 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 32 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
33 } | 33 } |
34 | 34 |
35 MenuManagerFactory::~MenuManagerFactory() {} | 35 MenuManagerFactory::~MenuManagerFactory() {} |
36 | 36 |
37 KeyedService* MenuManagerFactory::BuildServiceInstanceFor( | 37 KeyedService* MenuManagerFactory::BuildServiceInstanceFor( |
38 content::BrowserContext* context) const { | 38 content::BrowserContext* context) const { |
39 Profile* profile = Profile::FromBrowserContext(context); | 39 Profile* profile = Profile::FromBrowserContext(context); |
40 return new MenuManager( | 40 return new MenuManager(profile, ExtensionSystem::Get(profile)->state_store()); |
41 profile, | |
42 ExtensionSystem::Get(profile)->state_store()); | |
43 } | 41 } |
44 | 42 |
45 content::BrowserContext* MenuManagerFactory::GetBrowserContextToUse( | 43 content::BrowserContext* MenuManagerFactory::GetBrowserContextToUse( |
46 content::BrowserContext* context) const { | 44 content::BrowserContext* context) const { |
47 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); | 45 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); |
48 } | 46 } |
49 | 47 |
50 bool MenuManagerFactory::ServiceIsCreatedWithBrowserContext() const { | 48 bool MenuManagerFactory::ServiceIsCreatedWithBrowserContext() const { |
51 return true; | 49 return true; |
52 } | 50 } |
53 | 51 |
54 bool MenuManagerFactory::ServiceIsNULLWhileTesting() const { | 52 bool MenuManagerFactory::ServiceIsNULLWhileTesting() const { |
55 return true; | 53 return true; |
56 } | 54 } |
57 | 55 |
58 } // namespace extensions | 56 } // namespace extensions |
OLD | NEW |