Chromium Code Reviews| Index: chrome/browser/autocomplete/base_search_provider.h |
| diff --git a/chrome/browser/autocomplete/base_search_provider.h b/chrome/browser/autocomplete/base_search_provider.h |
| index 0f3b05cc8bcee79af17d326a4cede724ecdf68ff..795b18531e2f4f8d5e6a47d27de98a84175a5c48 100644 |
| --- a/chrome/browser/autocomplete/base_search_provider.h |
| +++ b/chrome/browser/autocomplete/base_search_provider.h |
| @@ -15,6 +15,7 @@ |
| #include <vector> |
| #include "base/memory/scoped_vector.h" |
| +#include "base/metrics/user_metrics_action.h" |
| #include "base/strings/string16.h" |
| #include "components/metrics/proto/omnibox_event.pb.h" |
| #include "components/omnibox/autocomplete_input.h" |
| @@ -51,6 +52,8 @@ class BaseSearchProvider : public AutocompleteProvider { |
| BaseSearchProvider(TemplateURLService* template_url_service, |
| Profile* profile, |
| + const base::UserMetricsAction& uma_deletion_success, |
| + const base::UserMetricsAction& uma_deletion_failure, |
|
Peter Kasting
2014/08/12 18:31:18
Unfortunately you can't pass in UMAs like this. R
hashimoto
2014/08/13 05:21:22
Ugh, you're right.
I should have carefully read th
|
| AutocompleteProvider::Type type); |
| // Returns whether |match| is flagged as a query that should be prefetched. |
| @@ -68,7 +71,6 @@ class BaseSearchProvider : public AutocompleteProvider { |
| const SearchTermsData& search_terms_data); |
| // AutocompleteProvider: |
| - virtual void Stop(bool clear_cached_results) OVERRIDE; |
| virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; |
| virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; |
| @@ -181,9 +183,12 @@ class BaseSearchProvider : public AutocompleteProvider { |
| // AutocompleteMatch. |
| // |mark_as_deletable| indicates whether the match should be marked deletable. |
| // NOTE: Any result containing a deletion URL is always marked deletable. |
| - void AddMatchToMap(const SearchSuggestionParser::SuggestResult& result, |
| + void 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); |
| @@ -194,37 +199,11 @@ class BaseSearchProvider : public AutocompleteProvider { |
| // keyword provider. |
| // Returns whether the appropriate result list members were updated. |
| bool ParseSuggestResults(const base::Value& root_val, |
| + const AutocompleteInput& input, |
| int default_result_relevance, |
| bool is_keyword_result, |
| SearchSuggestionParser::Results* results); |
| - // Returns the TemplateURL corresponding to the keyword or default |
| - // provider based on the value of |is_keyword|. |
| - virtual const TemplateURL* GetTemplateURL(bool is_keyword) const = 0; |
| - |
| - // Returns the AutocompleteInput for keyword provider or default provider |
| - // based on the value of |is_keyword|. |
| - virtual const AutocompleteInput GetInput(bool is_keyword) const = 0; |
| - |
| - // Returns whether the destination URL corresponding to the given |result| |
| - // should contain command-line-specified query params. |
| - virtual bool ShouldAppendExtraParams( |
| - const SearchSuggestionParser::SuggestResult& result) const = 0; |
| - |
| - // Stops the suggest query. |
| - // NOTE: This does not update |done_|. Callers must do so. |
| - virtual void StopSuggest() = 0; |
| - |
| - // Clears the current results. |
| - virtual void ClearAllResults() = 0; |
| - |
| - // Records in UMA whether the deletion request resulted in success. |
| - virtual void RecordDeletionResult(bool success) = 0; |
| - |
| - // Modify provider-specific UMA statistics. |
| - virtual void ModifyProviderInfo( |
| - metrics::OmniboxEventProto_ProviderInfo* provider_info) const; |
| - |
| TemplateURLService* template_url_service_; |
| Profile* profile_; |
| @@ -251,6 +230,9 @@ class BaseSearchProvider : public AutocompleteProvider { |
| void OnDeletionComplete(bool success, |
| SuggestionDeletionHandler* handler); |
| + base::UserMetricsAction uma_deletion_success_; |
| + base::UserMetricsAction uma_deletion_failure_; |
| + |
| // Each deletion handler in this vector corresponds to an outstanding request |
| // that a server delete a personalized suggestion. Making this a ScopedVector |
| // causes us to auto-cancel all such requests on shutdown. |