| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_model.h" | 5 #include "chrome/browser/search_engines/template_url_model.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 std::string prepopulate_id = | 828 std::string prepopulate_id = |
| 829 prefs->GetString(prefs::kDefaultSearchProviderPrepopulateID); | 829 prefs->GetString(prefs::kDefaultSearchProviderPrepopulateID); |
| 830 | 830 |
| 831 default_provider->reset(new TemplateURL()); | 831 default_provider->reset(new TemplateURL()); |
| 832 (*default_provider)->set_short_name(name); | 832 (*default_provider)->set_short_name(name); |
| 833 (*default_provider)->SetURL(search_url, 0, 0); | 833 (*default_provider)->SetURL(search_url, 0, 0); |
| 834 (*default_provider)->SetSuggestionsURL(suggest_url, 0, 0); | 834 (*default_provider)->SetSuggestionsURL(suggest_url, 0, 0); |
| 835 (*default_provider)->set_keyword(keyword); | 835 (*default_provider)->set_keyword(keyword); |
| 836 (*default_provider)->SetFavIconURL(GURL(icon_url)); | 836 (*default_provider)->SetFavIconURL(GURL(icon_url)); |
| 837 std::vector<std::string> encodings_vector; | 837 std::vector<std::string> encodings_vector; |
| 838 SplitString(encodings, ';', &encodings_vector); | 838 base::SplitString(encodings, ';', &encodings_vector); |
| 839 (*default_provider)->set_input_encodings(encodings_vector); | 839 (*default_provider)->set_input_encodings(encodings_vector); |
| 840 if (!id_string.empty()) { | 840 if (!id_string.empty()) { |
| 841 int64 value; | 841 int64 value; |
| 842 base::StringToInt64(id_string, &value); | 842 base::StringToInt64(id_string, &value); |
| 843 (*default_provider)->set_id(value); | 843 (*default_provider)->set_id(value); |
| 844 } | 844 } |
| 845 if (!prepopulate_id.empty()) { | 845 if (!prepopulate_id.empty()) { |
| 846 int value; | 846 int value; |
| 847 base::StringToInt(prepopulate_id, &value); | 847 base::StringToInt(prepopulate_id, &value); |
| 848 (*default_provider)->set_prepopulate_id(value); | 848 (*default_provider)->set_prepopulate_id(value); |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 void TemplateURLModel::NotifyObservers() { | 1245 void TemplateURLModel::NotifyObservers() { |
| 1246 if (!loaded_) | 1246 if (!loaded_) |
| 1247 return; | 1247 return; |
| 1248 | 1248 |
| 1249 FOR_EACH_OBSERVER(TemplateURLModelObserver, model_observers_, | 1249 FOR_EACH_OBSERVER(TemplateURLModelObserver, model_observers_, |
| 1250 OnTemplateURLModelChanged()); | 1250 OnTemplateURLModelChanged()); |
| 1251 } | 1251 } |
| 1252 | 1252 |
| OLD | NEW |