OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 void LoadURLInContents(TabContents* target_contents, | 245 void LoadURLInContents(TabContents* target_contents, |
246 const GURL& url, | 246 const GURL& url, |
247 browser::NavigateParams* params, | 247 browser::NavigateParams* params, |
248 const std::string& extra_headers) { | 248 const std::string& extra_headers) { |
249 if (params->transferred_global_request_id != GlobalRequestID()) { | 249 if (params->transferred_global_request_id != GlobalRequestID()) { |
250 target_contents->controller().TransferURL( | 250 target_contents->controller().TransferURL( |
251 url, | 251 url, |
252 params->referrer, | 252 params->referrer, |
253 params->transition, extra_headers, | 253 params->transition, extra_headers, |
| 254 target_contents->content_frame()->opener(), |
254 params->transferred_global_request_id, | 255 params->transferred_global_request_id, |
255 params->is_renderer_initiated); | 256 params->is_renderer_initiated); |
256 } else if (params->is_renderer_initiated) { | 257 } else if (params->is_renderer_initiated) { |
257 target_contents->controller().LoadURLFromRenderer( | 258 target_contents->controller().LoadURLFromRenderer( |
258 url, | 259 url, |
259 params->referrer, | 260 params->referrer, |
260 params->transition, extra_headers); | 261 params->transition, extra_headers, |
| 262 target_contents->content_frame()->opener()); |
261 } else { | 263 } else { |
262 target_contents->controller().LoadURL( | 264 target_contents->controller().LoadURL( |
263 url, | 265 url, |
264 params->referrer, | 266 params->referrer, |
265 params->transition, extra_headers); | 267 params->transition, extra_headers); |
266 } | 268 } |
267 | 269 |
268 } | 270 } |
269 | 271 |
270 // This class makes sure the Browser object held in |params| is made visible | 272 // This class makes sure the Browser object held in |params| is made visible |
271 // by the time it goes out of scope, provided |params| wants it to be shown. | 273 // by the time it goes out of scope, provided |params| wants it to be shown. |
272 class ScopedBrowserDisplayer { | 274 class ScopedBrowserDisplayer { |
273 public: | 275 public: |
274 explicit ScopedBrowserDisplayer(browser::NavigateParams* params) | 276 explicit ScopedBrowserDisplayer(browser::NavigateParams* params) |
275 : params_(params) { | 277 : params_(params) { |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 | 643 |
642 return !(url.scheme() == chrome::kChromeUIScheme && | 644 return !(url.scheme() == chrome::kChromeUIScheme && |
643 (url.host() == chrome::kChromeUISettingsHost || | 645 (url.host() == chrome::kChromeUISettingsHost || |
644 url.host() == chrome::kChromeUISettingsFrameHost || | 646 url.host() == chrome::kChromeUISettingsFrameHost || |
645 url.host() == chrome::kChromeUIExtensionsHost || | 647 url.host() == chrome::kChromeUIExtensionsHost || |
646 url.host() == chrome::kChromeUIBookmarksHost || | 648 url.host() == chrome::kChromeUIBookmarksHost || |
647 url.host() == chrome::kChromeUISyncPromoHost)); | 649 url.host() == chrome::kChromeUISyncPromoHost)); |
648 } | 650 } |
649 | 651 |
650 } // namespace browser | 652 } // namespace browser |
OLD | NEW |