| 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/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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 search_args.image_url = GURL(); | 235 search_args.image_url = GURL(); |
| 236 search_args.image_original_size = original_size; | 236 search_args.image_original_size = original_size; |
| 237 TemplateURLRef::PostContent post_content; | 237 TemplateURLRef::PostContent post_content; |
| 238 GURL result(default_provider->image_url_ref().ReplaceSearchTerms( | 238 GURL result(default_provider->image_url_ref().ReplaceSearchTerms( |
| 239 search_args, template_url_service->search_terms_data(), &post_content)); | 239 search_args, template_url_service->search_terms_data(), &post_content)); |
| 240 if (!result.is_valid()) | 240 if (!result.is_valid()) |
| 241 return; | 241 return; |
| 242 | 242 |
| 243 content::OpenURLParams open_url_params( | 243 content::OpenURLParams open_url_params( |
| 244 result, content::Referrer(), NEW_FOREGROUND_TAB, | 244 result, content::Referrer(), NEW_FOREGROUND_TAB, |
| 245 content::PAGE_TRANSITION_LINK, false); | 245 ui::PAGE_TRANSITION_LINK, false); |
| 246 const std::string& content_type = post_content.first; | 246 const std::string& content_type = post_content.first; |
| 247 std::string* post_data = &post_content.second; | 247 std::string* post_data = &post_content.second; |
| 248 if (!post_data->empty()) { | 248 if (!post_data->empty()) { |
| 249 DCHECK(!content_type.empty()); | 249 DCHECK(!content_type.empty()); |
| 250 open_url_params.uses_post = true; | 250 open_url_params.uses_post = true; |
| 251 open_url_params.browser_initiated_post_data = | 251 open_url_params.browser_initiated_post_data = |
| 252 base::RefCountedString::TakeString(post_data); | 252 base::RefCountedString::TakeString(post_data); |
| 253 open_url_params.extra_headers += base::StringPrintf( | 253 open_url_params.extra_headers += base::StringPrintf( |
| 254 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, | 254 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, |
| 255 content_type.c_str()); | 255 content_type.c_str()); |
| 256 } | 256 } |
| 257 web_contents()->OpenURL(open_url_params); | 257 web_contents()->OpenURL(open_url_params); |
| 258 } | 258 } |
| OLD | NEW |