| Index: chrome/browser/autocomplete/base_search_provider.cc
|
| diff --git a/chrome/browser/autocomplete/base_search_provider.cc b/chrome/browser/autocomplete/base_search_provider.cc
|
| index 29a6ac0c7225ee38eb04a4322b8c999aae250402..860dd69b8b03de283177ed8781775b7732a0c315 100644
|
| --- a/chrome/browser/autocomplete/base_search_provider.cc
|
| +++ b/chrome/browser/autocomplete/base_search_provider.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/autocomplete/base_search_provider.h"
|
|
|
| #include "base/i18n/case_conversion.h"
|
| +#include "base/metrics/user_metrics.h"
|
| #include "base/prefs/pref_registry_simple.h"
|
| #include "base/prefs/pref_service.h"
|
| #include "base/strings/string_util.h"
|
| @@ -94,14 +95,19 @@ const int BaseSearchProvider::kDefaultProviderURLFetcherID = 1;
|
| const int BaseSearchProvider::kKeywordProviderURLFetcherID = 2;
|
| const int BaseSearchProvider::kDeletionURLFetcherID = 3;
|
|
|
| -BaseSearchProvider::BaseSearchProvider(TemplateURLService* template_url_service,
|
| - Profile* profile,
|
| - AutocompleteProvider::Type type)
|
| +BaseSearchProvider::BaseSearchProvider(
|
| + TemplateURLService* template_url_service,
|
| + Profile* profile,
|
| + const base::UserMetricsAction& uma_deletion_success,
|
| + const base::UserMetricsAction& uma_deletion_failure,
|
| + AutocompleteProvider::Type type)
|
| : AutocompleteProvider(type),
|
| template_url_service_(template_url_service),
|
| profile_(profile),
|
| field_trial_triggered_(false),
|
| - field_trial_triggered_in_session_(false) {
|
| + field_trial_triggered_in_session_(false),
|
| + uma_deletion_success_(uma_deletion_success),
|
| + uma_deletion_failure_(uma_deletion_failure) {
|
| }
|
|
|
| // static
|
| @@ -124,14 +130,6 @@ AutocompleteMatch BaseSearchProvider::CreateSearchSuggestion(
|
| template_url, search_terms_data, 0, false);
|
| }
|
|
|
| -void BaseSearchProvider::Stop(bool clear_cached_results) {
|
| - StopSuggest();
|
| - done_ = true;
|
| -
|
| - if (clear_cached_results)
|
| - ClearAllResults();
|
| -}
|
| -
|
| void BaseSearchProvider::DeleteMatch(const AutocompleteMatch& match) {
|
| DCHECK(match.deletable);
|
| if (!match.GetAdditionalInfo(BaseSearchProvider::kDeletionUrlKey).empty()) {
|
| @@ -173,7 +171,6 @@ void BaseSearchProvider::AddProviderInfo(ProvidersInfo* provider_info) const {
|
| field_trial_hashes[i]);
|
| }
|
| }
|
| - ModifyProviderInfo(&new_entry);
|
| }
|
|
|
| // static
|
| @@ -366,16 +363,18 @@ bool BaseSearchProvider::CanSendURL(
|
| }
|
|
|
| void BaseSearchProvider::AddMatchToMap(
|
| + const AutocompleteInput& input,
|
| const SearchSuggestionParser::SuggestResult& result,
|
| + const TemplateURL* template_url,
|
| const std::string& metadata,
|
| int accepted_suggestion,
|
| + bool should_append_extra_params,
|
| bool mark_as_deletable,
|
| MatchMap* map) {
|
| AutocompleteMatch match = CreateSearchSuggestion(
|
| - this, GetInput(result.from_keyword_provider()), result,
|
| - GetTemplateURL(result.from_keyword_provider()),
|
| + this, input, result, template_url,
|
| template_url_service_->search_terms_data(), accepted_suggestion,
|
| - ShouldAppendExtraParams(result));
|
| + should_append_extra_params);
|
| if (!match.destination_url.is_valid())
|
| return;
|
| match.search_terms_args->bookmark_bar_pinned =
|
| @@ -444,11 +443,12 @@ void BaseSearchProvider::AddMatchToMap(
|
|
|
| bool BaseSearchProvider::ParseSuggestResults(
|
| const base::Value& root_val,
|
| + const AutocompleteInput& input,
|
| int default_result_relevance,
|
| bool is_keyword_result,
|
| SearchSuggestionParser::Results* results) {
|
| if (!SearchSuggestionParser::ParseSuggestResults(
|
| - root_val, GetInput(is_keyword_result),
|
| + root_val, input,
|
| ChromeAutocompleteSchemeClassifier(profile_), default_result_relevance,
|
| profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
|
| is_keyword_result, results))
|
| @@ -467,10 +467,6 @@ bool BaseSearchProvider::ParseSuggestResults(
|
| return true;
|
| }
|
|
|
| -void BaseSearchProvider::ModifyProviderInfo(
|
| - metrics::OmniboxEventProto_ProviderInfo* provider_info) const {
|
| -}
|
| -
|
| void BaseSearchProvider::DeleteMatchFromMatches(
|
| const AutocompleteMatch& match) {
|
| for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) {
|
| @@ -488,7 +484,7 @@ void BaseSearchProvider::DeleteMatchFromMatches(
|
|
|
| void BaseSearchProvider::OnDeletionComplete(
|
| bool success, SuggestionDeletionHandler* handler) {
|
| - RecordDeletionResult(success);
|
| + base::RecordAction(success ? uma_deletion_success_ : uma_deletion_failure_);
|
| SuggestionDeletionHandlers::iterator it = std::find(
|
| deletion_handlers_.begin(), deletion_handlers_.end(), handler);
|
| DCHECK(it != deletion_handlers_.end());
|
|
|