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

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 1158523002: Add user_gesture param to BaseWindow::Show Base URL: https://chromium.googlesource.com/chromium/src.git@ug3_BaseWindow_Activate
Patch Set: Update callers Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 class ScopedBrowserShower { 289 class ScopedBrowserShower {
290 public: 290 public:
291 explicit ScopedBrowserShower(chrome::NavigateParams* params) 291 explicit ScopedBrowserShower(chrome::NavigateParams* params)
292 : params_(params) { 292 : params_(params) {
293 } 293 }
294 ~ScopedBrowserShower() { 294 ~ScopedBrowserShower() {
295 if (params_->window_action == 295 if (params_->window_action ==
296 chrome::NavigateParams::SHOW_WINDOW_INACTIVE) { 296 chrome::NavigateParams::SHOW_WINDOW_INACTIVE) {
297 params_->browser->window()->ShowInactive(); 297 params_->browser->window()->ShowInactive();
298 } else if (params_->window_action == chrome::NavigateParams::SHOW_WINDOW) { 298 } else if (params_->window_action == chrome::NavigateParams::SHOW_WINDOW) {
299 params_->browser->window()->Show(); 299 params_->browser->window()->Show(params_->user_gesture);
300 // If a user gesture opened a popup window, focus the contents. 300 // If a user gesture opened a popup window, focus the contents.
301 if (params_->user_gesture && params_->disposition == NEW_POPUP && 301 if (params_->user_gesture && params_->disposition == NEW_POPUP &&
302 params_->target_contents) { 302 params_->target_contents) {
303 params_->target_contents->Focus(); 303 params_->target_contents->Focus();
304 } 304 }
305 } 305 }
306 } 306 }
307 307
308 private: 308 private:
309 chrome::NavigateParams* params_; 309 chrome::NavigateParams* params_;
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 bool reverse_on_redirect = false; 751 bool reverse_on_redirect = false;
752 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 752 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
753 &rewritten_url, browser_context, &reverse_on_redirect); 753 &rewritten_url, browser_context, &reverse_on_redirect);
754 754
755 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 755 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
756 return !(rewritten_url.scheme() == content::kChromeUIScheme && 756 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
757 rewritten_url.host() == chrome::kChromeUIUberHost); 757 rewritten_url.host() == chrome::kChromeUIUberHost);
758 } 758 }
759 759
760 } // namespace chrome 760 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_focus_uitest.cc ('k') | chrome/browser/ui/browser_tab_restore_service_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698