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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 load_url_params.transition_type = params->transition; | 228 load_url_params.transition_type = params->transition; |
229 load_url_params.extra_headers = params->extra_headers; | 229 load_url_params.extra_headers = params->extra_headers; |
230 | 230 |
231 if (params->transferred_global_request_id != GlobalRequestID()) { | 231 if (params->transferred_global_request_id != GlobalRequestID()) { |
232 load_url_params.is_renderer_initiated = params->is_renderer_initiated; | 232 load_url_params.is_renderer_initiated = params->is_renderer_initiated; |
233 load_url_params.transferred_global_request_id = | 233 load_url_params.transferred_global_request_id = |
234 params->transferred_global_request_id; | 234 params->transferred_global_request_id; |
235 } else if (params->is_renderer_initiated) { | 235 } else if (params->is_renderer_initiated) { |
236 load_url_params.is_renderer_initiated = true; | 236 load_url_params.is_renderer_initiated = true; |
237 } | 237 } |
238 if (params->transition == content::PAGE_TRANSITION_FORM_SUBMIT) { | |
239 load_url_params.load_type = | |
240 content::NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; | |
Charlie Reis
2012/11/05 16:21:40
This seems wrong to me. BROWSER_INITIATED_HTTP_PO
| |
241 load_url_params.request = params->request; | |
242 } | |
238 target_contents->GetController().LoadURLWithParams(load_url_params); | 243 target_contents->GetController().LoadURLWithParams(load_url_params); |
239 } | 244 } |
240 | 245 |
241 // This class makes sure the Browser object held in |params| is made visible | 246 // This class makes sure the Browser object held in |params| is made visible |
242 // by the time it goes out of scope, provided |params| wants it to be shown. | 247 // by the time it goes out of scope, provided |params| wants it to be shown. |
243 class ScopedBrowserDisplayer { | 248 class ScopedBrowserDisplayer { |
244 public: | 249 public: |
245 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) | 250 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) |
246 : params_(params) { | 251 : params_(params) { |
247 } | 252 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
585 bool reverse_on_redirect = false; | 590 bool reverse_on_redirect = false; |
586 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 591 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
587 &rewritten_url, browser_context, &reverse_on_redirect); | 592 &rewritten_url, browser_context, &reverse_on_redirect); |
588 | 593 |
589 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 594 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
590 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 595 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
591 rewritten_url.host() == chrome::kChromeUIUberHost); | 596 rewritten_url.host() == chrome::kChromeUIUberHost); |
592 } | 597 } |
593 | 598 |
594 } // namespace chrome | 599 } // namespace chrome |
OLD | NEW |