| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 139 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| 140 profile->GetOriginalProfile()); | 140 profile->GetOriginalProfile()); |
| 141 if (!service || service->HasSyncSetupCompleted()) | 141 if (!service || service->HasSyncSetupCompleted()) |
| 142 return false; | 142 return false; |
| 143 | 143 |
| 144 // Default to allow the promo. | 144 // Default to allow the promo. |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // static | 148 // static |
| 149 void SyncPromoUI::RegisterUserPrefs(PrefService* prefs) { | 149 void SyncPromoUI::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 150 prefs->RegisterIntegerPref( | 150 prefs->RegisterIntegerPref(prefs::kSyncPromoStartupCount, 0, |
| 151 prefs::kSyncPromoStartupCount, 0, PrefService::UNSYNCABLE_PREF); | 151 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 152 prefs->RegisterBooleanPref( | 152 prefs->RegisterBooleanPref(prefs::kSyncPromoUserSkipped, false, |
| 153 prefs::kSyncPromoUserSkipped, false, PrefService::UNSYNCABLE_PREF); | 153 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 154 prefs->RegisterBooleanPref(prefs::kSyncPromoShowOnFirstRunAllowed, true, | 154 prefs->RegisterBooleanPref(prefs::kSyncPromoShowOnFirstRunAllowed, true, |
| 155 PrefService::UNSYNCABLE_PREF); | 155 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 156 | 156 |
| 157 SyncPromoHandler::RegisterUserPrefs(prefs); | 157 SyncPromoHandler::RegisterUserPrefs(prefs); |
| 158 } | 158 } |
| 159 | 159 |
| 160 // static | 160 // static |
| 161 bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile, | 161 bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile, |
| 162 bool is_new_profile) { | 162 bool is_new_profile) { |
| 163 DCHECK(profile); | 163 DCHECK(profile); |
| 164 | 164 |
| 165 if (!ShouldShowSyncPromo(profile)) | 165 if (!ShouldShowSyncPromo(profile)) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 // static | 305 // static |
| 306 bool SyncPromoUI::UseWebBasedSigninFlow() { | 306 bool SyncPromoUI::UseWebBasedSigninFlow() { |
| 307 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 307 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 308 return CommandLine::ForCurrentProcess()->HasSwitch( | 308 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 309 switches::kUseWebBasedSigninFlow); | 309 switches::kUseWebBasedSigninFlow); |
| 310 #else | 310 #else |
| 311 return false; | 311 return false; |
| 312 #endif | 312 #endif |
| 313 } | 313 } |
| OLD | NEW |