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 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 Loading... |
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 |
OLD | NEW |