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

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

Issue 10409034: Fixing activation problem: Pages which refresh themselves should not get focus (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 44b531485ccb6ce4ef74d301c91670fc871b1e22..e725c6bc2b0e92e5d708ce07e92ef3720ec7b96e 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2695,6 +2695,13 @@ void Browser::UpdateUIForNavigationInTab(TabContentsWrapper* contents,
// navigating away from the new tab page.
ScheduleUIUpdate(contents->web_contents(), content::INVALIDATE_TYPE_URL);
+#if defined(USE_ASH)
+ // When using ash it is not desirable to switch to a new window when the
sky 2012/05/18 19:43:30 Why is this specific to ash? Additionally I'm not
Mr4D (OOO till 08-26) 2012/05/18 20:27:01 user_initiated: the problem is that if the page r
+ // page refresh wasn't initiated by the user (but instead by a page refresh).
+ if (!user_initiated)
+ return;
+#endif
+
if (contents_is_selected)
contents->web_contents()->Focus();
}
@@ -3409,7 +3416,12 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
nav_params.referrer = params.referrer;
nav_params.disposition = params.disposition;
nav_params.tabstrip_add_types = TabStripModel::ADD_NONE;
- nav_params.window_action = browser::NavigateParams::SHOW_WINDOW;
+#if defined(USE_ASH)
sky 2012/05/18 19:43:30 Whats the motivation for this?
Mr4D (OOO till 08-26) 2012/05/18 20:27:01 When this flag gets set, the LoadURL call further
+ // If the current tab is initiating this, we don't want to update.
+ if (nav_params.window_action != browser::NavigateParams::NO_ACTION ||
+ params.disposition != CURRENT_TAB)
+#endif
+ nav_params.window_action = browser::NavigateParams::SHOW_WINDOW;
nav_params.user_gesture = true;
nav_params.override_encoding = params.override_encoding;
nav_params.is_renderer_initiated = params.is_renderer_initiated;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698