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

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

Issue 9225053: Add a blocking version of the sync promo dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 10 months 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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 return GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value) ? 288 return GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value) ?
289 value : std::string(); 289 value : std::string();
290 } 290 }
291 291
292 // static 292 // static
293 bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) { 293 bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) {
294 return profile->GetPrefs()->GetInteger(prefs::kSyncPromoStartupCount) > 0; 294 return profile->GetPrefs()->GetInteger(prefs::kSyncPromoStartupCount) > 0;
295 } 295 }
296 296
297 // static 297 // static
298 int SyncPromoUI::GetSyncPromoVersion() { 298 SyncPromoUI::Version SyncPromoUI::GetSyncPromoVersion() {
299 int version = 0; 299 int value = 0;
300 if (base::StringToInt(CommandLine::ForCurrentProcess()-> 300 if (base::StringToInt(CommandLine::ForCurrentProcess()->
301 GetSwitchValueASCII(switches::kSyncPromoVersion), &version)) { 301 GetSwitchValueASCII(switches::kSyncPromoVersion), &value)) {
302 return version; 302 if (value >= VERSION_DEFAULT && value < VERSION_COUNT)
303 return static_cast<Version>(value);
303 } 304 }
305
306 Version version;
304 if (sync_promo_trial::GetSyncPromoVersionForCurrentTrial(&version)) 307 if (sync_promo_trial::GetSyncPromoVersionForCurrentTrial(&version))
305 return version; 308 return version;
306 // Default promo version is 0. 309
307 return 0; 310 return VERSION_DEFAULT;
308 } 311 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_ui.h ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698