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

Unified Diff: chrome/browser/ui/browser_navigator.cc

Issue 21378002: Support POST in browser navaigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: move PageNavigator Destructor body back Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_navigator.h ('k') | chrome/browser/ui/browser_navigator_browsertest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_navigator.cc
===================================================================
--- chrome/browser/ui/browser_navigator.cc (revision 215511)
+++ chrome/browser/ui/browser_navigator.cc (working copy)
@@ -45,6 +45,7 @@
#endif
using content::GlobalRequestID;
+using content::NavigationController;
using content::WebContents;
class BrowserNavigatorWebContentsAdoption {
@@ -243,7 +244,7 @@
void LoadURLInContents(WebContents* target_contents,
const GURL& url,
chrome::NavigateParams* params) {
- content::NavigationController::LoadURLParams load_url_params(url);
+ NavigationController::LoadURLParams load_url_params(url);
load_url_params.referrer = params->referrer;
load_url_params.transition_type = params->transition;
load_url_params.extra_headers = params->extra_headers;
@@ -257,6 +258,14 @@
} else if (params->is_renderer_initiated) {
load_url_params.is_renderer_initiated = true;
}
+
+ // Only allows the browser-initiated navigation to use POST.
+ if (params->uses_post && !params->is_renderer_initiated) {
+ load_url_params.load_type =
+ NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST;
+ load_url_params.browser_initiated_post_data =
+ params->browser_initiated_post_data;
+ }
target_contents->GetController().LoadURLWithParams(load_url_params);
}
@@ -382,6 +391,7 @@
const GURL& a_url,
content::PageTransition a_transition)
: url(a_url),
+ uses_post(false),
target_contents(NULL),
source_contents(NULL),
disposition(CURRENT_TAB),
@@ -402,7 +412,8 @@
NavigateParams::NavigateParams(Browser* a_browser,
WebContents* a_target_contents)
- : target_contents(a_target_contents),
+ : uses_post(false),
+ target_contents(a_target_contents),
source_contents(NULL),
disposition(CURRENT_TAB),
transition(content::PAGE_TRANSITION_LINK),
@@ -424,6 +435,7 @@
const GURL& a_url,
content::PageTransition a_transition)
: url(a_url),
+ uses_post(false),
target_contents(NULL),
source_contents(NULL),
disposition(NEW_FOREGROUND_TAB),
@@ -455,6 +467,8 @@
params.transferred_global_request_id;
nav_params->should_replace_current_entry =
params.should_replace_current_entry;
+ nav_params->uses_post = params.uses_post;
+ nav_params->browser_initiated_post_data = params.browser_initiated_post_data;
}
void Navigate(NavigateParams* params) {
« no previous file with comments | « chrome/browser/ui/browser_navigator.h ('k') | chrome/browser/ui/browser_navigator_browsertest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698