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

Side by Side Diff: chrome/browser/extensions/menu_manager_factory.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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
OLDNEW
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 "base/memory/ptr_util.h"
7 #include "chrome/browser/extensions/menu_manager.h" 8 #include "chrome/browser/extensions/menu_manager.h"
8 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "extensions/browser/extension_system.h" 11 #include "extensions/browser/extension_system.h"
11 #include "extensions/browser/extension_system_provider.h" 12 #include "extensions/browser/extension_system_provider.h"
12 #include "extensions/browser/extensions_browser_client.h" 13 #include "extensions/browser/extensions_browser_client.h"
13 14
14 namespace extensions { 15 namespace extensions {
15 16
16 // static 17 // static
17 MenuManager* MenuManagerFactory::GetForBrowserContext( 18 MenuManager* MenuManagerFactory::GetForBrowserContext(
18 content::BrowserContext* context) { 19 content::BrowserContext* context) {
19 return static_cast<MenuManager*>( 20 return static_cast<MenuManager*>(
20 GetInstance()->GetServiceForBrowserContext(context, true)); 21 GetInstance()->GetServiceForBrowserContext(context, true));
21 } 22 }
22 23
23 // static 24 // static
24 MenuManagerFactory* MenuManagerFactory::GetInstance() { 25 MenuManagerFactory* MenuManagerFactory::GetInstance() {
25 return base::Singleton<MenuManagerFactory>::get(); 26 return base::Singleton<MenuManagerFactory>::get();
26 } 27 }
27 28
28 // static 29 // static
29 scoped_ptr<KeyedService> MenuManagerFactory::BuildServiceInstanceForTesting( 30 std::unique_ptr<KeyedService>
31 MenuManagerFactory::BuildServiceInstanceForTesting(
30 content::BrowserContext* context) { 32 content::BrowserContext* context) {
31 return make_scoped_ptr(GetInstance()->BuildServiceInstanceFor(context)); 33 return base::WrapUnique(GetInstance()->BuildServiceInstanceFor(context));
32 } 34 }
33 35
34 MenuManagerFactory::MenuManagerFactory() 36 MenuManagerFactory::MenuManagerFactory()
35 : BrowserContextKeyedServiceFactory( 37 : BrowserContextKeyedServiceFactory(
36 "MenuManager", 38 "MenuManager",
37 BrowserContextDependencyManager::GetInstance()) { 39 BrowserContextDependencyManager::GetInstance()) {
38 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 40 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
39 } 41 }
40 42
41 MenuManagerFactory::~MenuManagerFactory() {} 43 MenuManagerFactory::~MenuManagerFactory() {}
(...skipping 11 matching lines...) Expand all
53 55
54 bool MenuManagerFactory::ServiceIsCreatedWithBrowserContext() const { 56 bool MenuManagerFactory::ServiceIsCreatedWithBrowserContext() const {
55 return true; 57 return true;
56 } 58 }
57 59
58 bool MenuManagerFactory::ServiceIsNULLWhileTesting() const { 60 bool MenuManagerFactory::ServiceIsNULLWhileTesting() const {
59 return true; 61 return true;
60 } 62 }
61 63
62 } // namespace extensions 64 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager_factory.h ('k') | chrome/browser/extensions/menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698