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/macros.h" | 10 #include "base/macros.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 target_contents_owner_.reset(params_->target_contents); | 323 target_contents_owner_.reset(params_->target_contents); |
324 } | 324 } |
325 | 325 |
326 // Relinquishes ownership of |params_|' target_contents. | 326 // Relinquishes ownership of |params_|' target_contents. |
327 WebContents* ReleaseOwnership() { | 327 WebContents* ReleaseOwnership() { |
328 return target_contents_owner_.release(); | 328 return target_contents_owner_.release(); |
329 } | 329 } |
330 | 330 |
331 private: | 331 private: |
332 chrome::NavigateParams* params_; | 332 chrome::NavigateParams* params_; |
333 scoped_ptr<WebContents> target_contents_owner_; | 333 std::unique_ptr<WebContents> target_contents_owner_; |
334 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner); | 334 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner); |
335 }; | 335 }; |
336 | 336 |
337 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, | 337 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, |
338 const GURL& url) { | 338 const GURL& url) { |
339 WebContents::CreateParams create_params( | 339 WebContents::CreateParams create_params( |
340 params.browser->profile(), | 340 params.browser->profile(), |
341 params.source_site_instance | 341 params.source_site_instance |
342 ? params.source_site_instance | 342 ? params.source_site_instance |
343 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); | 343 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 bool reverse_on_redirect = false; | 646 bool reverse_on_redirect = false; |
647 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 647 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
648 &rewritten_url, browser_context, &reverse_on_redirect); | 648 &rewritten_url, browser_context, &reverse_on_redirect); |
649 | 649 |
650 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 650 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
651 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 651 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
652 rewritten_url.host() == chrome::kChromeUIUberHost); | 652 rewritten_url.host() == chrome::kChromeUIUberHost); |
653 } | 653 } |
654 | 654 |
655 } // namespace chrome | 655 } // namespace chrome |
OLD | NEW |