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/ui/webui/sync_promo/sync_promo_ui.h" | 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 140 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
141 profile->GetOriginalProfile()); | 141 profile->GetOriginalProfile()); |
142 if (!service || service->HasSyncSetupCompleted()) | 142 if (!service || service->HasSyncSetupCompleted()) |
143 return false; | 143 return false; |
144 | 144 |
145 // Default to allow the promo. | 145 // Default to allow the promo. |
146 return true; | 146 return true; |
147 } | 147 } |
148 | 148 |
149 // static | 149 // static |
150 void SyncPromoUI::RegisterUserPrefs(PrefService* prefs) { | 150 void SyncPromoUI::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
151 prefs->RegisterIntegerPref( | 151 prefs->RegisterIntegerPref(prefs::kSyncPromoStartupCount, 0, |
152 prefs::kSyncPromoStartupCount, 0, PrefService::UNSYNCABLE_PREF); | 152 PrefServiceSyncable::UNSYNCABLE_PREF); |
153 prefs->RegisterBooleanPref( | 153 prefs->RegisterBooleanPref(prefs::kSyncPromoUserSkipped, false, |
154 prefs::kSyncPromoUserSkipped, false, PrefService::UNSYNCABLE_PREF); | 154 PrefServiceSyncable::UNSYNCABLE_PREF); |
155 prefs->RegisterBooleanPref(prefs::kSyncPromoShowOnFirstRunAllowed, true, | 155 prefs->RegisterBooleanPref(prefs::kSyncPromoShowOnFirstRunAllowed, true, |
156 PrefService::UNSYNCABLE_PREF); | 156 PrefServiceSyncable::UNSYNCABLE_PREF); |
157 | 157 |
158 SyncPromoHandler::RegisterUserPrefs(prefs); | 158 SyncPromoHandler::RegisterUserPrefs(prefs); |
159 } | 159 } |
160 | 160 |
161 // static | 161 // static |
162 bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile, | 162 bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile, |
163 bool is_new_profile) { | 163 bool is_new_profile) { |
164 DCHECK(profile); | 164 DCHECK(profile); |
165 | 165 |
166 if (!ShouldShowSyncPromo(profile)) | 166 if (!ShouldShowSyncPromo(profile)) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 // static | 308 // static |
309 bool SyncPromoUI::UseWebBasedSigninFlow() { | 309 bool SyncPromoUI::UseWebBasedSigninFlow() { |
310 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 310 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
311 return CommandLine::ForCurrentProcess()->HasSwitch( | 311 return CommandLine::ForCurrentProcess()->HasSwitch( |
312 switches::kUseWebBasedSigninFlow); | 312 switches::kUseWebBasedSigninFlow); |
313 #else | 313 #else |
314 return false; | 314 return false; |
315 #endif | 315 #endif |
316 } | 316 } |
OLD | NEW |