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

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

Issue 11193051: To fix the cross-site post submission bug. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reuse ResourceRequestBody Struct Created 8 years, 1 month 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.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 using content::NavigationEntry; 216 using content::NavigationEntry;
217 using content::OpenURLParams; 217 using content::OpenURLParams;
218 using content::PluginService; 218 using content::PluginService;
219 using content::Referrer; 219 using content::Referrer;
220 using content::SiteInstance; 220 using content::SiteInstance;
221 using content::UserMetricsAction; 221 using content::UserMetricsAction;
222 using content::WebContents; 222 using content::WebContents;
223 using extensions::Extension; 223 using extensions::Extension;
224 using ui::WebDialogDelegate; 224 using ui::WebDialogDelegate;
225 225
226 struct ViewMsg_Request;
michaeln 2012/11/02 00:08:23 is this needed, given the assignment below, seems
irobert 2012/11/02 17:22:55 Done.
227
226 /////////////////////////////////////////////////////////////////////////////// 228 ///////////////////////////////////////////////////////////////////////////////
227 229
228 namespace { 230 namespace {
229 231
230 // The URL to be loaded to display the "Report a broken page" form. 232 // The URL to be loaded to display the "Report a broken page" form.
231 const char kBrokenPageUrl[] = 233 const char kBrokenPageUrl[] =
232 "https://www.google.com/support/chrome/bin/request.py?contact_type=" 234 "https://www.google.com/support/chrome/bin/request.py?contact_type="
233 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2"; 235 "broken_website&format=inproduct&p.page_title=$1&p.page_url=$2";
234 236
235 // How long we wait before updating the browser chrome while loading a page. 237 // How long we wait before updating the browser chrome while loading a page.
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 nav_params.referrer = params.referrer; 1286 nav_params.referrer = params.referrer;
1285 nav_params.extra_headers = params.extra_headers; 1287 nav_params.extra_headers = params.extra_headers;
1286 nav_params.disposition = params.disposition; 1288 nav_params.disposition = params.disposition;
1287 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; 1289 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE;
1288 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW; 1290 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW;
1289 nav_params.user_gesture = true; 1291 nav_params.user_gesture = true;
1290 nav_params.override_encoding = params.override_encoding; 1292 nav_params.override_encoding = params.override_encoding;
1291 nav_params.is_renderer_initiated = params.is_renderer_initiated; 1293 nav_params.is_renderer_initiated = params.is_renderer_initiated;
1292 nav_params.transferred_global_request_id = 1294 nav_params.transferred_global_request_id =
1293 params.transferred_global_request_id; 1295 params.transferred_global_request_id;
1296 // set post data
1297 if (params.transition == content::PAGE_TRANSITION_FORM_SUBMIT) {
1298 nav_params.request = params.request;
1299 }
1300
1294 chrome::Navigate(&nav_params); 1301 chrome::Navigate(&nav_params);
1295 1302
1296 return nav_params.target_contents ? 1303 return nav_params.target_contents ?
1297 nav_params.target_contents->web_contents() : NULL; 1304 nav_params.target_contents->web_contents() : NULL;
1298 } 1305 }
1299 1306
1300 void Browser::NavigationStateChanged(const WebContents* source, 1307 void Browser::NavigationStateChanged(const WebContents* source,
1301 unsigned changed_flags) { 1308 unsigned changed_flags) {
1302 // Only update the UI when something visible has changed. 1309 // Only update the UI when something visible has changed.
1303 if (changed_flags) 1310 if (changed_flags)
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 if (contents && !allow_js_access) { 2355 if (contents && !allow_js_access) {
2349 contents->web_contents()->GetController().LoadURL( 2356 contents->web_contents()->GetController().LoadURL(
2350 target_url, 2357 target_url,
2351 content::Referrer(), 2358 content::Referrer(),
2352 content::PAGE_TRANSITION_LINK, 2359 content::PAGE_TRANSITION_LINK,
2353 std::string()); // No extra headers. 2360 std::string()); // No extra headers.
2354 } 2361 }
2355 2362
2356 return contents != NULL; 2363 return contents != NULL;
2357 } 2364 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.h » ('j') | chrome/browser/ui/browser_navigator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698