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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 load_url_params.extra_headers = params->extra_headers; | 231 load_url_params.extra_headers = params->extra_headers; |
232 load_url_params.is_cross_site_redirect = params->is_cross_site_redirect; | 232 load_url_params.is_cross_site_redirect = params->is_cross_site_redirect; |
233 | 233 |
234 if (params->transferred_global_request_id != GlobalRequestID()) { | 234 if (params->transferred_global_request_id != GlobalRequestID()) { |
235 load_url_params.is_renderer_initiated = params->is_renderer_initiated; | 235 load_url_params.is_renderer_initiated = params->is_renderer_initiated; |
236 load_url_params.transferred_global_request_id = | 236 load_url_params.transferred_global_request_id = |
237 params->transferred_global_request_id; | 237 params->transferred_global_request_id; |
238 } else if (params->is_renderer_initiated) { | 238 } else if (params->is_renderer_initiated) { |
239 load_url_params.is_renderer_initiated = true; | 239 load_url_params.is_renderer_initiated = true; |
240 } | 240 } |
| 241 if (params->transition == content::PAGE_TRANSITION_FORM_SUBMIT) { |
| 242 load_url_params.load_type = |
| 243 content::NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; |
| 244 load_url_params.browser_initiated_post_data = |
| 245 params->post_data; |
| 246 } |
241 target_contents->GetController().LoadURLWithParams(load_url_params); | 247 target_contents->GetController().LoadURLWithParams(load_url_params); |
242 } | 248 } |
243 | 249 |
244 // This class makes sure the Browser object held in |params| is made visible | 250 // This class makes sure the Browser object held in |params| is made visible |
245 // by the time it goes out of scope, provided |params| wants it to be shown. | 251 // by the time it goes out of scope, provided |params| wants it to be shown. |
246 class ScopedBrowserDisplayer { | 252 class ScopedBrowserDisplayer { |
247 public: | 253 public: |
248 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) | 254 explicit ScopedBrowserDisplayer(chrome::NavigateParams* params) |
249 : params_(params) { | 255 : params_(params) { |
250 } | 256 } |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 bool reverse_on_redirect = false; | 597 bool reverse_on_redirect = false; |
592 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 598 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
593 &rewritten_url, browser_context, &reverse_on_redirect); | 599 &rewritten_url, browser_context, &reverse_on_redirect); |
594 | 600 |
595 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 601 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
596 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 602 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
597 rewritten_url.host() == chrome::kChromeUIUberHost); | 603 rewritten_url.host() == chrome::kChromeUIUberHost); |
598 } | 604 } |
599 | 605 |
600 } // namespace chrome | 606 } // namespace chrome |
OLD | NEW |