| 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/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 if (params->source_contents) | 211 if (params->source_contents) |
| 212 return params->source_contents->profile(); | 212 return params->source_contents->profile(); |
| 213 | 213 |
| 214 return source_browser->profile(); | 214 return source_browser->profile(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void LoadURLInContents(WebContents* target_contents, | 217 void LoadURLInContents(WebContents* target_contents, |
| 218 const GURL& url, | 218 const GURL& url, |
| 219 chrome::NavigateParams* params, | 219 chrome::NavigateParams* params, |
| 220 const std::string& extra_headers) { | 220 const std::string& extra_headers) { |
| 221 content::NavigationController::LoadURLParams load_url_params(url); |
| 222 load_url_params.referrer = params->referrer; |
| 223 load_url_params.transition_type = params->transition; |
| 224 load_url_params.extra_headers = extra_headers; |
| 225 |
| 221 if (params->transferred_global_request_id != GlobalRequestID()) { | 226 if (params->transferred_global_request_id != GlobalRequestID()) { |
| 222 target_contents->GetController().TransferURL( | 227 load_url_params.is_renderer_initiated = params->is_renderer_initiated; |
| 223 url, | 228 load_url_params.transferred_global_request_id = |
| 224 params->referrer, | 229 params->transferred_global_request_id; |
| 225 params->transition, extra_headers, | |
| 226 params->transferred_global_request_id, | |
| 227 params->is_renderer_initiated); | |
| 228 } else if (params->is_renderer_initiated) { | 230 } else if (params->is_renderer_initiated) { |
| 229 target_contents->GetController().LoadURLFromRenderer( | 231 load_url_params.is_renderer_initiated = true; |
| 230 url, | |
| 231 params->referrer, | |
| 232 params->transition, extra_headers); | |
| 233 } else { | |
| 234 target_contents->GetController().LoadURL( | |
| 235 url, | |
| 236 params->referrer, | |
| 237 params->transition, extra_headers); | |
| 238 } | 232 } |
| 239 | 233 target_contents->GetController().LoadURLWithParams(load_url_params); |
| 240 } | 234 } |
| 241 | 235 |
| 242 // This class makes sure the Browser object held in |params| is made visible | 236 // This class makes sure the Browser object held in |params| is made visible |
| 243 // by the time it goes out of scope, provided |params| wants it to be shown. | 237 // by the time it goes out of scope, provided |params| wants it to be shown. |
| 244 class ScopedBrowserDisplayer { | 238 class ScopedBrowserDisplayer { |
| 245 public: | 239 public: |
| 246 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) | 240 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) |
| 247 : params_(params) { | 241 : params_(params) { |
| 248 } | 242 } |
| 249 ~ScopedBrowserDisplayer() { | 243 ~ScopedBrowserDisplayer() { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 return !(url.scheme() == chrome::kChromeUIScheme && | 577 return !(url.scheme() == chrome::kChromeUIScheme && |
| 584 (url.host() == chrome::kChromeUISettingsHost || | 578 (url.host() == chrome::kChromeUISettingsHost || |
| 585 url.host() == chrome::kChromeUISettingsFrameHost || | 579 url.host() == chrome::kChromeUISettingsFrameHost || |
| 586 url.host() == chrome::kChromeUIExtensionsHost || | 580 url.host() == chrome::kChromeUIExtensionsHost || |
| 587 url.host() == chrome::kChromeUIBookmarksHost || | 581 url.host() == chrome::kChromeUIBookmarksHost || |
| 588 url.host() == chrome::kChromeUISyncPromoHost || | 582 url.host() == chrome::kChromeUISyncPromoHost || |
| 589 url.host() == chrome::kChromeUIUberHost)); | 583 url.host() == chrome::kChromeUIUberHost)); |
| 590 } | 584 } |
| 591 | 585 |
| 592 } // namespace chrome | 586 } // namespace chrome |
| OLD | NEW |