| OLD | NEW |
| 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 Loading... |
| 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 if (params_->user_gesture) |
| 300 params_->browser->window()->ShowForUserGesture(); |
| 301 else |
| 302 params_->browser->window()->Show(); |
| 300 // If a user gesture opened a popup window, focus the contents. | 303 // If a user gesture opened a popup window, focus the contents. |
| 301 if (params_->user_gesture && params_->disposition == NEW_POPUP && | 304 if (params_->user_gesture && params_->disposition == NEW_POPUP && |
| 302 params_->target_contents) { | 305 params_->target_contents) { |
| 303 params_->target_contents->Focus(); | 306 params_->target_contents->Focus(); |
| 304 } | 307 } |
| 305 } | 308 } |
| 306 } | 309 } |
| 307 | 310 |
| 308 private: | 311 private: |
| 309 chrome::NavigateParams* params_; | 312 chrome::NavigateParams* params_; |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 bool reverse_on_redirect = false; | 754 bool reverse_on_redirect = false; |
| 752 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 755 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 753 &rewritten_url, browser_context, &reverse_on_redirect); | 756 &rewritten_url, browser_context, &reverse_on_redirect); |
| 754 | 757 |
| 755 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 758 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
| 756 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 759 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
| 757 rewritten_url.host() == chrome::kChromeUIUberHost); | 760 rewritten_url.host() == chrome::kChromeUIUberHost); |
| 758 } | 761 } |
| 759 | 762 |
| 760 } // namespace chrome | 763 } // namespace chrome |
| OLD | NEW |