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

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

Issue 11193051: To fix the cross-site post submission bug. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android API, Helper Function and Include_rules Created 8 years 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 | Annotate | Revision Log
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator.h ('k') | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698