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

Side by Side Diff: chrome/browser/ui/app_list/app_list_prefs_factory.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/app_list/app_list_prefs_factory.h" 5 #include "chrome/browser/ui/app_list/app_list_prefs_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/app_list/app_list_prefs.h" 10 #include "chrome/browser/ui/app_list/app_list_prefs.h"
(...skipping 11 matching lines...) Expand all
22 GetInstance()->GetServiceForBrowserContext(context, true)); 22 GetInstance()->GetServiceForBrowserContext(context, true));
23 } 23 }
24 24
25 // static 25 // static
26 AppListPrefsFactory* AppListPrefsFactory::GetInstance() { 26 AppListPrefsFactory* AppListPrefsFactory::GetInstance() {
27 return base::Singleton<AppListPrefsFactory>::get(); 27 return base::Singleton<AppListPrefsFactory>::get();
28 } 28 }
29 29
30 void AppListPrefsFactory::SetInstanceForTesting( 30 void AppListPrefsFactory::SetInstanceForTesting(
31 content::BrowserContext* context, 31 content::BrowserContext* context,
32 scoped_ptr<AppListPrefs> prefs) { 32 std::unique_ptr<AppListPrefs> prefs) {
33 Associate(context, std::move(prefs)); 33 Associate(context, std::move(prefs));
34 } 34 }
35 35
36 AppListPrefsFactory::AppListPrefsFactory() 36 AppListPrefsFactory::AppListPrefsFactory()
37 : BrowserContextKeyedServiceFactory( 37 : BrowserContextKeyedServiceFactory(
38 "AppListPrefs", 38 "AppListPrefs",
39 BrowserContextDependencyManager::GetInstance()) { 39 BrowserContextDependencyManager::GetInstance()) {
40 } 40 }
41 41
42 AppListPrefsFactory::~AppListPrefsFactory() { 42 AppListPrefsFactory::~AppListPrefsFactory() {
43 } 43 }
44 44
45 KeyedService* AppListPrefsFactory::BuildServiceInstanceFor( 45 KeyedService* AppListPrefsFactory::BuildServiceInstanceFor(
46 content::BrowserContext* context) const { 46 content::BrowserContext* context) const {
47 return AppListPrefs::Create(Profile::FromBrowserContext(context)->GetPrefs()); 47 return AppListPrefs::Create(Profile::FromBrowserContext(context)->GetPrefs());
48 } 48 }
49 49
50 content::BrowserContext* AppListPrefsFactory::GetBrowserContextToUse( 50 content::BrowserContext* AppListPrefsFactory::GetBrowserContextToUse(
51 content::BrowserContext* context) const { 51 content::BrowserContext* context) const {
52 return extensions::ExtensionsBrowserClient::Get()->GetOriginalContext( 52 return extensions::ExtensionsBrowserClient::Get()->GetOriginalContext(
53 context); 53 context);
54 } 54 }
55 55
56 } // namespace app_list 56 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_prefs_factory.h ('k') | chrome/browser/ui/app_list/app_list_service_cocoa_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698