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

Unified Diff: chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc

Issue 10806048: Change the navigation code of sync promo slightly to navigate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/webui/sync_promo/sync_promo_handler.cc
===================================================================
--- chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc (revision 147566)
+++ chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc (working copy)
@@ -189,16 +189,22 @@
if (!username.empty())
prefs_->SetBoolean(prefs::kSyncPromoShowNTPBubble, true);
- // If the browser window is being closed then don't try to navigate to another
- // URL. This prevents the browser window from flashing during close.
+ // If the browser window is being closed then don't try to navigate to
+ // another URL. This prevents the browser window from flashing during
+ // close.
Browser* browser =
browser::FindBrowserWithWebContents(web_ui()->GetWebContents());
if (!browser || !browser->IsAttemptingToCloseBrowser()) {
- GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL(
- web_ui()->GetWebContents()->GetURL());
- OpenURLParams params(
- url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
- web_ui()->GetWebContents()->OpenURL(params);
+ // Close the window if it was opened in auto-close mode.
+ const GURL& sync_url = web_ui()->GetWebContents()->GetURL();
+ if (SyncPromoUI::GetAutoCloseForSyncPromoURL(sync_url)) {
+ web_ui()->GetWebContents()->Close();
+ } else {
+ GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL(sync_url);
+ OpenURLParams params(
+ url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false);
+ web_ui()->GetWebContents()->OpenURL(params);
+ }
}
}
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.cc ('k') | chrome/browser/ui/webui/sync_promo/sync_promo_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698