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

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_ui.h ('k') | chrome/browser/ui/window_snapshot/window_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698