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

Side by Side Diff: components/search_engines/template_url_prepopulate_data.cc

Issue 1135163002: Omnibox - Strip Extra Whitespace from Custom Search Engine Names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more tests that don't set short_name Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/search_engines/template_url_prepopulate_data.h" 5 #include "components/search_engines/template_url_prepopulate_data.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <locale.h> 8 #include <locale.h>
9 #endif 9 #endif
10 10
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 const base::StringPiece& suggest_url_post_params, 1043 const base::StringPiece& suggest_url_post_params,
1044 const base::StringPiece& instant_url_post_params, 1044 const base::StringPiece& instant_url_post_params,
1045 const base::StringPiece& image_url_post_params, 1045 const base::StringPiece& image_url_post_params,
1046 const base::StringPiece& favicon_url, 1046 const base::StringPiece& favicon_url,
1047 const base::StringPiece& encoding, 1047 const base::StringPiece& encoding,
1048 const base::ListValue& alternate_urls, 1048 const base::ListValue& alternate_urls,
1049 const base::StringPiece& search_terms_replacement_key, 1049 const base::StringPiece& search_terms_replacement_key,
1050 int id) { 1050 int id) {
1051 scoped_ptr<TemplateURLData> data(new TemplateURLData); 1051 scoped_ptr<TemplateURLData> data(new TemplateURLData);
1052 1052
1053 data->short_name = name; 1053 data->SetShortName(name);
1054 data->SetKeyword(keyword); 1054 data->SetKeyword(keyword);
1055 data->SetURL(search_url.as_string()); 1055 data->SetURL(search_url.as_string());
1056 data->suggestions_url = suggest_url.as_string(); 1056 data->suggestions_url = suggest_url.as_string();
1057 data->instant_url = instant_url.as_string(); 1057 data->instant_url = instant_url.as_string();
1058 data->image_url = image_url.as_string(); 1058 data->image_url = image_url.as_string();
1059 data->new_tab_url = new_tab_url.as_string(); 1059 data->new_tab_url = new_tab_url.as_string();
1060 data->contextual_search_url = contextual_search_url.as_string(); 1060 data->contextual_search_url = contextual_search_url.as_string();
1061 data->search_url_post_params = search_url_post_params.as_string(); 1061 data->search_url_post_params = search_url_post_params.as_string();
1062 data->suggestions_url_post_params = suggest_url_post_params.as_string(); 1062 data->suggestions_url_post_params = suggest_url_post_params.as_string();
1063 data->instant_url_post_params = instant_url_post_params.as_string(); 1063 data->instant_url_post_params = instant_url_post_params.as_string();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 for (size_t j = 0; j < kAllEngines[i]->alternate_urls_size; ++j) { 1271 for (size_t j = 0; j < kAllEngines[i]->alternate_urls_size; ++j) {
1272 if (SameDomain(url, GURL(kAllEngines[i]->alternate_urls[j]))) 1272 if (SameDomain(url, GURL(kAllEngines[i]->alternate_urls[j])))
1273 return kAllEngines[i]->type; 1273 return kAllEngines[i]->type;
1274 } 1274 }
1275 } 1275 }
1276 1276
1277 return SEARCH_ENGINE_OTHER; 1277 return SEARCH_ENGINE_OTHER;
1278 } 1278 }
1279 1279
1280 } // namespace TemplateURLPrepopulateData 1280 } // namespace TemplateURLPrepopulateData
OLDNEW
« no previous file with comments | « components/search_engines/template_url_parser.cc ('k') | components/search_engines/template_url_prepopulate_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698