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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 8093016: Show sync promo at startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 237de737150747e80c53f4be9d10b8908af6fd50..cf29f554eed5043f98cbc4e760cbed36fb0ec360 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -58,6 +58,7 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/browser/ui/webui/sync_promo_ui.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_result_codes.h"
@@ -1249,7 +1250,13 @@ void BrowserInit::LaunchWithProfile::AddStartupURLs(
while (it != browser_init_->first_run_tabs_.end()) {
// Replace magic names for the actual urls.
if (it->host() == "new_tab_page") {
- startup_urls->push_back(GURL(chrome::kChromeUINewTabURL));
+ if (SyncPromoUI::ShouldShowSyncPromoAtStartup(profile_,
+ FirstRun::IsChromeFirstRun())) {
+ SyncPromoUI::DidShowSyncPromoAtStartup(profile_);
+ startup_urls->push_back(GURL(chrome::kChromeUISyncPromoURL));
+ } else {
+ startup_urls->push_back(GURL(chrome::kChromeUINewTabURL));
+ }
} else if (it->host() == "welcome_page") {
startup_urls->push_back(GetWelcomePageURL());
} else {
@@ -1265,7 +1272,13 @@ void BrowserInit::LaunchWithProfile::AddStartupURLs(
// Otherwise open at least the new tab page (and the welcome page, if this
// is the first time the browser is being started), or the set of URLs
// specified on the command line.
- startup_urls->push_back(GURL()); // New tab page.
+ if (SyncPromoUI::ShouldShowSyncPromoAtStartup(profile_,
+ FirstRun::IsChromeFirstRun())) {
+ SyncPromoUI::DidShowSyncPromoAtStartup(profile_);
+ startup_urls->push_back(GURL(chrome::kChromeUISyncPromoURL));
+ } else {
+ startup_urls->push_back(GURL()); // New tab page.
+ }
PrefService* prefs = g_browser_process->local_state();
if (prefs->FindPreference(prefs::kShouldShowWelcomePage) &&
prefs->GetBoolean(prefs::kShouldShowWelcomePage)) {

Powered by Google App Engine
This is Rietveld 408576698