Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 10830144: Consolidate all NavigationController::LoadURL and family functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: NOTREACHED checks for post/data loads. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
221 if (params->transferred_global_request_id != GlobalRequestID()) { 225 if (params->transferred_global_request_id != GlobalRequestID()) {
222 target_contents->GetController().TransferURL( 226 load_url_params.transferred_global_request_id =
223 url, 227 params->transferred_global_request_id;
224 params->referrer,
225 params->transition, extra_headers,
226 params->transferred_global_request_id,
227 params->is_renderer_initiated);
Charlie Reis 2012/08/03 21:28:36 You've lost params->is_renderer_initiated in this
boliu 2012/08/03 22:42:08 Very good catch! Fixed.
228 } else if (params->is_renderer_initiated) { 228 } else if (params->is_renderer_initiated) {
229 target_contents->GetController().LoadURLFromRenderer( 229 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 } 230 }
239 231 target_contents->GetController().LoadURLWithParams(load_url_params);
240 } 232 }
241 233
242 // This class makes sure the Browser object held in |params| is made visible 234 // 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. 235 // by the time it goes out of scope, provided |params| wants it to be shown.
244 class ScopedBrowserDisplayer { 236 class ScopedBrowserDisplayer {
245 public: 237 public:
246 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) 238 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params)
247 : params_(params) { 239 : params_(params) {
248 } 240 }
249 ~ScopedBrowserDisplayer() { 241 ~ScopedBrowserDisplayer() {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 return !(url.scheme() == chrome::kChromeUIScheme && 576 return !(url.scheme() == chrome::kChromeUIScheme &&
585 (url.host() == chrome::kChromeUISettingsHost || 577 (url.host() == chrome::kChromeUISettingsHost ||
586 url.host() == chrome::kChromeUISettingsFrameHost || 578 url.host() == chrome::kChromeUISettingsFrameHost ||
587 url.host() == chrome::kChromeUIExtensionsHost || 579 url.host() == chrome::kChromeUIExtensionsHost ||
588 url.host() == chrome::kChromeUIBookmarksHost || 580 url.host() == chrome::kChromeUIBookmarksHost ||
589 url.host() == chrome::kChromeUISyncPromoHost || 581 url.host() == chrome::kChromeUISyncPromoHost ||
590 url.host() == chrome::kChromeUIUberHost)); 582 url.host() == chrome::kChromeUIUberHost));
591 } 583 }
592 584
593 } // namespace chrome 585 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698