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

Side by Side Diff: chrome/browser/bookmarks/managed_bookmark_service_factory.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/bookmarks/managed_bookmark_service_factory.h" 5 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 12 matching lines...) Expand all
23 policy::ProfilePolicyConnector* connector = 23 policy::ProfilePolicyConnector* connector =
24 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile); 24 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile);
25 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) 25 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks))
26 return connector->GetManagementDomain(); 26 return connector->GetManagementDomain();
27 return std::string(); 27 return std::string();
28 } 28 }
29 29
30 std::unique_ptr<KeyedService> BuildManagedBookmarkService( 30 std::unique_ptr<KeyedService> BuildManagedBookmarkService(
31 content::BrowserContext* context) { 31 content::BrowserContext* context) {
32 Profile* profile = Profile::FromBrowserContext(context); 32 Profile* profile = Profile::FromBrowserContext(context);
33 return base::WrapUnique(new bookmarks::ManagedBookmarkService( 33 return base::MakeUnique<bookmarks::ManagedBookmarkService>(
34 profile->GetPrefs(), 34 profile->GetPrefs(),
35 base::Bind(&GetManagedBookmarksDomain, base::Unretained(profile)))); 35 base::Bind(&GetManagedBookmarksDomain, base::Unretained(profile)));
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 // static 40 // static
41 bookmarks::ManagedBookmarkService* ManagedBookmarkServiceFactory::GetForProfile( 41 bookmarks::ManagedBookmarkService* ManagedBookmarkServiceFactory::GetForProfile(
42 Profile* profile) { 42 Profile* profile) {
43 return static_cast<bookmarks::ManagedBookmarkService*>( 43 return static_cast<bookmarks::ManagedBookmarkService*>(
44 GetInstance()->GetServiceForBrowserContext(profile, true)); 44 GetInstance()->GetServiceForBrowserContext(profile, true));
45 } 45 }
(...skipping 24 matching lines...) Expand all
70 } 70 }
71 71
72 content::BrowserContext* ManagedBookmarkServiceFactory::GetBrowserContextToUse( 72 content::BrowserContext* ManagedBookmarkServiceFactory::GetBrowserContextToUse(
73 content::BrowserContext* context) const { 73 content::BrowserContext* context) const {
74 return chrome::GetBrowserContextRedirectedInIncognito(context); 74 return chrome::GetBrowserContextRedirectedInIncognito(context);
75 } 75 }
76 76
77 bool ManagedBookmarkServiceFactory::ServiceIsNULLWhileTesting() const { 77 bool ManagedBookmarkServiceFactory::ServiceIsNULLWhileTesting() const {
78 return true; 78 return true;
79 } 79 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model_factory.cc ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698