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

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

Issue 9193004: Fix flashing window when deleting profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated sync_promo_handler2.cc Created 8 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_promo/sync_promo_handler2.cc
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_handler2.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_handler2.cc
index cabbfc83dc80477dbccda41bc48cc5f67ea71538..431e24d58d2a8d645238b4d000f8315804db7c84 100644
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_handler2.cc
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_handler2.cc
@@ -204,10 +204,17 @@ void SyncPromoHandler2::HandleCloseSyncPromo(const base::ListValue* args) {
if (!username.empty())
prefs_->SetBoolean(prefs::kSyncPromoShowNTPBubble, true);
- GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL(
- web_ui_->tab_contents()->GetURL());
- web_ui_->tab_contents()->OpenURL(url, GURL(), CURRENT_TAB,
- content::PAGE_TRANSITION_LINK);
+ // 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 =
+ BrowserList::FindBrowserWithWebContents(web_ui()->GetWebContents());
+ if (browser && !browser->IsAttemptingToCloseBrowser()) {
+ GURL url = SyncPromoUI::GetNextPageURLForSyncPromoURL(
+ web_ui_->tab_contents()->GetURL());
+ web_ui_->tab_contents()->OpenURL(url, GURL(), CURRENT_TAB,
+ content::PAGE_TRANSITION_LINK);
+ }
}
void SyncPromoHandler2::HandleInitializeSyncPromo(const base::ListValue* args) {
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698