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

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

Issue 2038233002: Using ResourceRequestBody as the type of HTTP body outside of //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
Patch Set: Rebasing... Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/browser_navigator_params.cc ('k') | chrome/test/base/ui_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/tab_contents/core_tab_helper.h" 5 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 TemplateURLRef::PostContent post_content; 343 TemplateURLRef::PostContent post_content;
344 GURL result(default_provider->image_url_ref().ReplaceSearchTerms( 344 GURL result(default_provider->image_url_ref().ReplaceSearchTerms(
345 search_args, template_url_service->search_terms_data(), &post_content)); 345 search_args, template_url_service->search_terms_data(), &post_content));
346 if (!result.is_valid()) 346 if (!result.is_valid())
347 return; 347 return;
348 348
349 content::OpenURLParams open_url_params( 349 content::OpenURLParams open_url_params(
350 result, content::Referrer(), NEW_FOREGROUND_TAB, 350 result, content::Referrer(), NEW_FOREGROUND_TAB,
351 ui::PAGE_TRANSITION_LINK, false); 351 ui::PAGE_TRANSITION_LINK, false);
352 const std::string& content_type = post_content.first; 352 const std::string& content_type = post_content.first;
353 std::string* post_data = &post_content.second; 353 const std::string& post_data = post_content.second;
354 if (!post_data->empty()) { 354 if (!post_data.empty()) {
355 DCHECK(!content_type.empty()); 355 DCHECK(!content_type.empty());
356 open_url_params.uses_post = true; 356 open_url_params.uses_post = true;
357 open_url_params.browser_initiated_post_data = 357 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes(
358 base::RefCountedString::TakeString(post_data); 358 post_data.data(), post_data.size());
359 open_url_params.extra_headers += base::StringPrintf( 359 open_url_params.extra_headers += base::StringPrintf(
360 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, 360 "%s: %s\r\n", net::HttpRequestHeaders::kContentType,
361 content_type.c_str()); 361 content_type.c_str());
362 } 362 }
363 web_contents()->OpenURL(open_url_params); 363 web_contents()->OpenURL(open_url_params);
364 } 364 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator_params.cc ('k') | chrome/test/base/ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698