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/search_engines/template_url_service.h" | 5 #include "chrome/browser/search_engines/template_url_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 // This also calls NotifyObservers. | 952 // This also calls NotifyObservers. |
953 ChangeToLoadedState(); | 953 ChangeToLoadedState(); |
954 | 954 |
955 // Index any visits that occurred before we finished loading. | 955 // Index any visits that occurred before we finished loading. |
956 for (size_t i = 0; i < visits_to_add_.size(); ++i) | 956 for (size_t i = 0; i < visits_to_add_.size(); ++i) |
957 UpdateKeywordSearchTermsForURL(visits_to_add_[i]); | 957 UpdateKeywordSearchTermsForURL(visits_to_add_[i]); |
958 visits_to_add_.clear(); | 958 visits_to_add_.clear(); |
959 | 959 |
960 if (new_resource_keyword_version) | 960 if (new_resource_keyword_version) |
961 service_->SetBuiltinKeywordVersion(new_resource_keyword_version); | 961 service_->SetBuiltinKeywordVersion(new_resource_keyword_version); |
| 962 |
| 963 if (default_search_provider_) { |
| 964 UMA_HISTOGRAM_ENUMERATION("Search.DefaultSearchProviderType", |
| 965 TemplateURLPrepopulateData::GetEngineType(*default_search_provider_), |
| 966 SEARCH_ENGINE_MAX); |
| 967 } |
962 } | 968 } |
963 | 969 |
964 base::string16 TemplateURLService::GetKeywordShortName( | 970 base::string16 TemplateURLService::GetKeywordShortName( |
965 const base::string16& keyword, | 971 const base::string16& keyword, |
966 bool* is_omnibox_api_extension_keyword) { | 972 bool* is_omnibox_api_extension_keyword) { |
967 const TemplateURL* template_url = GetTemplateURLForKeyword(keyword); | 973 const TemplateURL* template_url = GetTemplateURLForKeyword(keyword); |
968 | 974 |
969 // TODO(sky): Once LocationBarView adds a listener to the TemplateURLService | 975 // TODO(sky): Once LocationBarView adds a listener to the TemplateURLService |
970 // to track changes to the model, this should become a DCHECK. | 976 // to track changes to the model, this should become a DCHECK. |
971 if (template_url) { | 977 if (template_url) { |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 | 2501 |
2496 if (most_recently_intalled_default) { | 2502 if (most_recently_intalled_default) { |
2497 base::AutoReset<DefaultSearchChangeOrigin> change_origin( | 2503 base::AutoReset<DefaultSearchChangeOrigin> change_origin( |
2498 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); | 2504 &dsp_change_origin_, DSP_CHANGE_OVERRIDE_SETTINGS_EXTENSION); |
2499 default_search_manager_.SetExtensionControlledDefaultSearchEngine( | 2505 default_search_manager_.SetExtensionControlledDefaultSearchEngine( |
2500 most_recently_intalled_default->data()); | 2506 most_recently_intalled_default->data()); |
2501 } else { | 2507 } else { |
2502 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); | 2508 default_search_manager_.ClearExtensionControlledDefaultSearchEngine(); |
2503 } | 2509 } |
2504 } | 2510 } |
OLD | NEW |