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

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

Issue 1861593005: Convert //ios 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 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/singleton.h" 8 #include "base/memory/singleton.h"
8 #include "components/google/core/browser/google_pref_names.h" 9 #include "components/google/core/browser/google_pref_names.h"
9 #include "components/google/core/browser/google_url_tracker.h" 10 #include "components/google/core/browser/google_url_tracker.h"
10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" 11 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
11 #include "components/prefs/pref_service.h" 12 #include "components/prefs/pref_service.h"
12 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" 13 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
13 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
14 #include "ios/chrome/browser/google/google_url_tracker_client_impl.h" 15 #include "ios/chrome/browser/google/google_url_tracker_client_impl.h"
15 16
16 namespace ios { 17 namespace ios {
(...skipping 12 matching lines...) Expand all
29 30
30 GoogleURLTrackerFactory::GoogleURLTrackerFactory() 31 GoogleURLTrackerFactory::GoogleURLTrackerFactory()
31 : BrowserStateKeyedServiceFactory( 32 : BrowserStateKeyedServiceFactory(
32 "GoogleURLTracker", 33 "GoogleURLTracker",
33 BrowserStateDependencyManager::GetInstance()) { 34 BrowserStateDependencyManager::GetInstance()) {
34 } 35 }
35 36
36 GoogleURLTrackerFactory::~GoogleURLTrackerFactory() { 37 GoogleURLTrackerFactory::~GoogleURLTrackerFactory() {
37 } 38 }
38 39
39 scoped_ptr<KeyedService> GoogleURLTrackerFactory::BuildServiceInstanceFor( 40 std::unique_ptr<KeyedService> GoogleURLTrackerFactory::BuildServiceInstanceFor(
40 web::BrowserState* context) const { 41 web::BrowserState* context) const {
41 ios::ChromeBrowserState* browser_state = 42 ios::ChromeBrowserState* browser_state =
42 ios::ChromeBrowserState::FromBrowserState(context); 43 ios::ChromeBrowserState::FromBrowserState(context);
43 44
44 // Delete this now-unused pref. 45 // Delete this now-unused pref.
45 // 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.
46 browser_state->GetOriginalChromeBrowserState()->GetPrefs()->ClearPref( 47 browser_state->GetOriginalChromeBrowserState()->GetPrefs()->ClearPref(
47 prefs::kLastPromptedGoogleURL); 48 prefs::kLastPromptedGoogleURL);
48 49
49 return make_scoped_ptr(new GoogleURLTracker( 50 return base::WrapUnique(new GoogleURLTracker(
50 make_scoped_ptr(new GoogleURLTrackerClientImpl(browser_state)), 51 base::WrapUnique(new GoogleURLTrackerClientImpl(browser_state)),
51 GoogleURLTracker::NORMAL_MODE)); 52 GoogleURLTracker::NORMAL_MODE));
52 } 53 }
53 54
54 web::BrowserState* GoogleURLTrackerFactory::GetBrowserStateToUse( 55 web::BrowserState* GoogleURLTrackerFactory::GetBrowserStateToUse(
55 web::BrowserState* context) const { 56 web::BrowserState* context) const {
56 return GetBrowserStateRedirectedInIncognito(context); 57 return GetBrowserStateRedirectedInIncognito(context);
57 } 58 }
58 59
59 bool GoogleURLTrackerFactory::ServiceIsCreatedWithBrowserState() const { 60 bool GoogleURLTrackerFactory::ServiceIsCreatedWithBrowserState() const {
60 return true; 61 return true;
61 } 62 }
62 63
63 bool GoogleURLTrackerFactory::ServiceIsNULLWhileTesting() const { 64 bool GoogleURLTrackerFactory::ServiceIsNULLWhileTesting() const {
64 return true; 65 return true;
65 } 66 }
66 67
67 void GoogleURLTrackerFactory::RegisterBrowserStatePrefs( 68 void GoogleURLTrackerFactory::RegisterBrowserStatePrefs(
68 user_prefs::PrefRegistrySyncable* registry) { 69 user_prefs::PrefRegistrySyncable* registry) {
69 GoogleURLTracker::RegisterProfilePrefs(registry); 70 GoogleURLTracker::RegisterProfilePrefs(registry);
70 } 71 }
71 72
72 } // namespace ios 73 } // namespace ios
OLDNEW
« no previous file with comments | « ios/chrome/browser/google/google_url_tracker_factory.h ('k') | ios/chrome/browser/history/history_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698