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/macros.h" | 10 #include "base/macros.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 load_url_params.frame_tree_node_id = params->frame_tree_node_id; | 259 load_url_params.frame_tree_node_id = params->frame_tree_node_id; |
260 load_url_params.redirect_chain = params->redirect_chain; | 260 load_url_params.redirect_chain = params->redirect_chain; |
261 load_url_params.transition_type = params->transition; | 261 load_url_params.transition_type = params->transition; |
262 load_url_params.extra_headers = params->extra_headers; | 262 load_url_params.extra_headers = params->extra_headers; |
263 load_url_params.should_replace_current_entry = | 263 load_url_params.should_replace_current_entry = |
264 params->should_replace_current_entry; | 264 params->should_replace_current_entry; |
265 load_url_params.is_renderer_initiated = params->is_renderer_initiated; | 265 load_url_params.is_renderer_initiated = params->is_renderer_initiated; |
266 | 266 |
267 // Only allows the browser-initiated navigation to use POST. | 267 // Only allows the browser-initiated navigation to use POST. |
268 if (params->uses_post && !params->is_renderer_initiated) { | 268 if (params->uses_post && !params->is_renderer_initiated) { |
269 load_url_params.load_type = | 269 load_url_params.method = "POST"; |
270 NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; | |
271 load_url_params.browser_initiated_post_data = | 270 load_url_params.browser_initiated_post_data = |
272 params->browser_initiated_post_data; | 271 params->browser_initiated_post_data; |
273 } | 272 } |
274 target_contents->GetController().LoadURLWithParams(load_url_params); | 273 target_contents->GetController().LoadURLWithParams(load_url_params); |
275 } | 274 } |
276 | 275 |
277 // This class makes sure the Browser object held in |params| is made visible | 276 // This class makes sure the Browser object held in |params| is made visible |
278 // by the time it goes out of scope, provided |params| wants it to be shown. | 277 // by the time it goes out of scope, provided |params| wants it to be shown. |
279 class ScopedBrowserShower { | 278 class ScopedBrowserShower { |
280 public: | 279 public: |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 bool reverse_on_redirect = false; | 645 bool reverse_on_redirect = false; |
647 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 646 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
648 &rewritten_url, browser_context, &reverse_on_redirect); | 647 &rewritten_url, browser_context, &reverse_on_redirect); |
649 | 648 |
650 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 649 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
651 return !(rewritten_url.scheme() == content::kChromeUIScheme && | 650 return !(rewritten_url.scheme() == content::kChromeUIScheme && |
652 rewritten_url.host() == chrome::kChromeUIUberHost); | 651 rewritten_url.host() == chrome::kChromeUIUberHost); |
653 } | 652 } |
654 | 653 |
655 } // namespace chrome | 654 } // namespace chrome |
OLD | NEW |