OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync/sync_promo_ui.h" | 5 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Display the signin promo if the user is not signed in. | 108 // Display the signin promo if the user is not signed in. |
109 SigninManager* signin = SigninManagerFactory::GetForProfile( | 109 SigninManager* signin = SigninManagerFactory::GetForProfile( |
110 profile->GetOriginalProfile()); | 110 profile->GetOriginalProfile()); |
111 return !signin->AuthInProgress() && signin->IsSigninAllowed() && | 111 return !signin->AuthInProgress() && signin->IsSigninAllowed() && |
112 signin->GetAuthenticatedUsername().empty(); | 112 signin->GetAuthenticatedUsername().empty(); |
113 #endif | 113 #endif |
114 } | 114 } |
115 | 115 |
116 // static | 116 // static |
117 void SyncPromoUI::RegisterUserPrefs( | 117 void SyncPromoUI::RegisterProfilePrefs( |
118 user_prefs::PrefRegistrySyncable* registry) { | 118 user_prefs::PrefRegistrySyncable* registry) { |
119 registry->RegisterIntegerPref( | 119 registry->RegisterIntegerPref( |
120 prefs::kSyncPromoStartupCount, | 120 prefs::kSyncPromoStartupCount, |
121 0, | 121 0, |
122 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 122 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
123 registry->RegisterBooleanPref( | 123 registry->RegisterBooleanPref( |
124 prefs::kSyncPromoUserSkipped, | 124 prefs::kSyncPromoUserSkipped, |
125 false, | 125 false, |
126 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 126 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
127 registry->RegisterBooleanPref( | 127 registry->RegisterBooleanPref( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 replacements.ClearQuery(); | 266 replacements.ClearQuery(); |
267 const std::string& locale = g_browser_process->GetApplicationLocale(); | 267 const std::string& locale = g_browser_process->GetApplicationLocale(); |
268 return url.ReplaceComponents(replacements) == | 268 return url.ReplaceComponents(replacements) == |
269 GURL(base::StringPrintf(kSyncLandingUrlPrefix, locale.c_str())); | 269 GURL(base::StringPrintf(kSyncLandingUrlPrefix, locale.c_str())); |
270 } | 270 } |
271 | 271 |
272 // static | 272 // static |
273 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { | 273 void SyncPromoUI::ForceWebBasedSigninFlowForTesting(bool force) { |
274 g_force_web_based_signin_flow = force; | 274 g_force_web_based_signin_flow = force; |
275 } | 275 } |
OLD | NEW |