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

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

Issue 621553002: Focus the contents of popup windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 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
« 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_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index b0961df5d6a65bb2557bdf1a4b4afba565d4d5c8..c32b1b6c06c5b1e16a2c377832bfa509df6781f5 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -288,11 +288,19 @@ class ScopedBrowserShower {
: params_(params) {
}
~ScopedBrowserShower() {
- if (params_->window_action == chrome::NavigateParams::SHOW_WINDOW_INACTIVE)
+ if (params_->window_action ==
+ chrome::NavigateParams::SHOW_WINDOW_INACTIVE) {
params_->browser->window()->ShowInactive();
- else if (params_->window_action == chrome::NavigateParams::SHOW_WINDOW)
+ } else if (params_->window_action == chrome::NavigateParams::SHOW_WINDOW) {
params_->browser->window()->Show();
+ // If a user gesture opened a popup window, focus the contents.
+ if (params_->user_gesture && params_->disposition == NEW_POPUP &&
+ params_->target_contents) {
+ params_->target_contents->Focus();
+ }
+ }
}
+
private:
chrome::NavigateParams* params_;
DISALLOW_COPY_AND_ASSIGN(ScopedBrowserShower);
« 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