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

Side by Side Diff: chrome/browser/search_engines/template_url_service.cc

Issue 7230053: Modify TemplateURLRef to remove unknown URL parameters, but only when it represents a prepopulate... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/search_engines/template_url_service.h" 5 #include "chrome/browser/search_engines/template_url_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 base::SplitString(encodings, ';', &encodings_vector); 884 base::SplitString(encodings, ';', &encodings_vector);
885 (*default_provider)->set_input_encodings(encodings_vector); 885 (*default_provider)->set_input_encodings(encodings_vector);
886 if (!id_string.empty() && !*is_managed) { 886 if (!id_string.empty() && !*is_managed) {
887 int64 value; 887 int64 value;
888 base::StringToInt64(id_string, &value); 888 base::StringToInt64(id_string, &value);
889 (*default_provider)->set_id(value); 889 (*default_provider)->set_id(value);
890 } 890 }
891 if (!prepopulate_id.empty() && !*is_managed) { 891 if (!prepopulate_id.empty() && !*is_managed) {
892 int value; 892 int value;
893 base::StringToInt(prepopulate_id, &value); 893 base::StringToInt(prepopulate_id, &value);
894 (*default_provider)->set_prepopulate_id(value); 894 (*default_provider)->SetPrepopulateId(value);
895 } 895 }
896 (*default_provider)->set_show_in_default_list(true); 896 (*default_provider)->set_show_in_default_list(true);
897 return true; 897 return true;
898 } 898 }
899 899
900 bool TemplateURLService::CanReplaceKeywordForHost( 900 bool TemplateURLService::CanReplaceKeywordForHost(
901 const std::string& host, 901 const std::string& host,
902 const TemplateURL** to_replace) { 902 const TemplateURL** to_replace) {
903 const TemplateURLSet* urls = provider_map_.GetURLsForHost(host); 903 const TemplateURLSet* urls = provider_map_.GetURLsForHost(host);
904 if (urls) { 904 if (urls) {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 1322
1323 i = template_urls->erase(i); 1323 i = template_urls->erase(i);
1324 if (service_.get()) 1324 if (service_.get())
1325 service_->RemoveKeyword(*template_url); 1325 service_->RemoveKeyword(*template_url);
1326 delete template_url; 1326 delete template_url;
1327 } else { 1327 } else {
1328 ++i; 1328 ++i;
1329 } 1329 }
1330 } 1330 }
1331 } 1331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698