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

Side by Side Diff: ios/chrome/browser/google/google_url_tracker_factory.cc

Issue 2256193002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 "ios/chrome/browser/google/google_url_tracker_factory.h" 5 #include "ios/chrome/browser/google/google_url_tracker_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "components/google/core/browser/google_pref_names.h" 9 #include "components/google/core/browser/google_pref_names.h"
10 #include "components/google/core/browser/google_url_tracker.h" 10 #include "components/google/core/browser/google_url_tracker.h"
(...skipping 29 matching lines...) Expand all
40 std::unique_ptr<KeyedService> GoogleURLTrackerFactory::BuildServiceInstanceFor( 40 std::unique_ptr<KeyedService> GoogleURLTrackerFactory::BuildServiceInstanceFor(
41 web::BrowserState* context) const { 41 web::BrowserState* context) const {
42 ios::ChromeBrowserState* browser_state = 42 ios::ChromeBrowserState* browser_state =
43 ios::ChromeBrowserState::FromBrowserState(context); 43 ios::ChromeBrowserState::FromBrowserState(context);
44 44
45 // Delete this now-unused pref. 45 // Delete this now-unused pref.
46 // At some point in the future, this code can be removed entirely. 46 // At some point in the future, this code can be removed entirely.
47 browser_state->GetOriginalChromeBrowserState()->GetPrefs()->ClearPref( 47 browser_state->GetOriginalChromeBrowserState()->GetPrefs()->ClearPref(
48 prefs::kLastPromptedGoogleURL); 48 prefs::kLastPromptedGoogleURL);
49 49
50 return base::WrapUnique(new GoogleURLTracker( 50 return base::MakeUnique<GoogleURLTracker>(
51 base::WrapUnique(new GoogleURLTrackerClientImpl(browser_state)), 51 base::WrapUnique(new GoogleURLTrackerClientImpl(browser_state)),
52 GoogleURLTracker::NORMAL_MODE)); 52 GoogleURLTracker::NORMAL_MODE);
53 } 53 }
54 54
55 web::BrowserState* GoogleURLTrackerFactory::GetBrowserStateToUse( 55 web::BrowserState* GoogleURLTrackerFactory::GetBrowserStateToUse(
56 web::BrowserState* context) const { 56 web::BrowserState* context) const {
57 return GetBrowserStateRedirectedInIncognito(context); 57 return GetBrowserStateRedirectedInIncognito(context);
58 } 58 }
59 59
60 bool GoogleURLTrackerFactory::ServiceIsCreatedWithBrowserState() const { 60 bool GoogleURLTrackerFactory::ServiceIsCreatedWithBrowserState() const {
61 return true; 61 return true;
62 } 62 }
63 63
64 bool GoogleURLTrackerFactory::ServiceIsNULLWhileTesting() const { 64 bool GoogleURLTrackerFactory::ServiceIsNULLWhileTesting() const {
65 return true; 65 return true;
66 } 66 }
67 67
68 void GoogleURLTrackerFactory::RegisterBrowserStatePrefs( 68 void GoogleURLTrackerFactory::RegisterBrowserStatePrefs(
69 user_prefs::PrefRegistrySyncable* registry) { 69 user_prefs::PrefRegistrySyncable* registry) {
70 GoogleURLTracker::RegisterProfilePrefs(registry); 70 GoogleURLTracker::RegisterProfilePrefs(registry);
71 } 71 }
72 72
73 } // namespace ios 73 } // namespace ios
OLDNEW
« no previous file with comments | « ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.cc ('k') | ios/chrome/browser/history/history_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698