OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/google/google_url_tracker_factory.h" | 5 #include "chrome/browser/google/google_url_tracker_factory.h" |
6 | 6 |
7 #include "chrome/browser/google/google_url_tracker.h" | 7 #include "chrome/browser/google/google_url_tracker.h" |
| 8 #include "chrome/browser/prefs/pref_registry_syncable.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/profile_dependency_manager.h" | 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
10 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
11 | 12 |
12 | 13 |
13 // static | 14 // static |
14 GoogleURLTracker* GoogleURLTrackerFactory::GetForProfile(Profile* profile) { | 15 GoogleURLTracker* GoogleURLTrackerFactory::GetForProfile(Profile* profile) { |
15 return static_cast<GoogleURLTracker*>( | 16 return static_cast<GoogleURLTracker*>( |
16 GetInstance()->GetServiceForProfile(profile, true)); | 17 GetInstance()->GetServiceForProfile(profile, true)); |
17 } | 18 } |
(...skipping 10 matching lines...) Expand all Loading... |
28 | 29 |
29 GoogleURLTrackerFactory::~GoogleURLTrackerFactory() { | 30 GoogleURLTrackerFactory::~GoogleURLTrackerFactory() { |
30 } | 31 } |
31 | 32 |
32 ProfileKeyedService* GoogleURLTrackerFactory::BuildServiceInstanceFor( | 33 ProfileKeyedService* GoogleURLTrackerFactory::BuildServiceInstanceFor( |
33 Profile* profile) const { | 34 Profile* profile) const { |
34 return new GoogleURLTracker(profile, GoogleURLTracker::NORMAL_MODE); | 35 return new GoogleURLTracker(profile, GoogleURLTracker::NORMAL_MODE); |
35 } | 36 } |
36 | 37 |
37 void GoogleURLTrackerFactory::RegisterUserPrefs( | 38 void GoogleURLTrackerFactory::RegisterUserPrefs( |
38 PrefServiceSyncable* user_prefs) { | 39 PrefRegistrySyncable* user_prefs) { |
39 user_prefs->RegisterStringPref(prefs::kLastKnownGoogleURL, | 40 user_prefs->RegisterStringPref(prefs::kLastKnownGoogleURL, |
40 GoogleURLTracker::kDefaultGoogleHomepage, | 41 GoogleURLTracker::kDefaultGoogleHomepage, |
41 PrefServiceSyncable::UNSYNCABLE_PREF); | 42 PrefRegistrySyncable::UNSYNCABLE_PREF); |
42 user_prefs->RegisterStringPref(prefs::kLastPromptedGoogleURL, | 43 user_prefs->RegisterStringPref(prefs::kLastPromptedGoogleURL, |
43 std::string(), | 44 std::string(), |
44 PrefServiceSyncable::UNSYNCABLE_PREF); | 45 PrefRegistrySyncable::UNSYNCABLE_PREF); |
45 } | 46 } |
46 | 47 |
47 bool GoogleURLTrackerFactory::ServiceRedirectedInIncognito() const { | 48 bool GoogleURLTrackerFactory::ServiceRedirectedInIncognito() const { |
48 return true; | 49 return true; |
49 } | 50 } |
50 | 51 |
51 bool GoogleURLTrackerFactory::ServiceIsCreatedWithProfile() const { | 52 bool GoogleURLTrackerFactory::ServiceIsCreatedWithProfile() const { |
52 return true; | 53 return true; |
53 } | 54 } |
54 | 55 |
55 bool GoogleURLTrackerFactory::ServiceIsNULLWhileTesting() const { | 56 bool GoogleURLTrackerFactory::ServiceIsNULLWhileTesting() const { |
56 return true; | 57 return true; |
57 } | 58 } |
OLD | NEW |