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

Unified Diff: chrome/browser/metrics/omnibox_metrics_provider.cc

Issue 320713002: Revert of Omnibox: Combine Two Input Type Enums into One (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autocomplete/zero_suggest_provider.cc ('k') | chrome/browser/omnibox/omnibox_log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/omnibox_metrics_provider.cc
diff --git a/chrome/browser/metrics/omnibox_metrics_provider.cc b/chrome/browser/metrics/omnibox_metrics_provider.cc
index 94847f91d7f956d459ade096b449ad1e85b078bf..430cfa16b74658517ba42c6529e19ccdeb64059f 100644
--- a/chrome/browser/metrics/omnibox_metrics_provider.cc
+++ b/chrome/browser/metrics/omnibox_metrics_provider.cc
@@ -17,13 +17,29 @@
#include "chrome/browser/omnibox/omnibox_log.h"
#include "chrome/browser/ui/browser_otr_state.h"
#include "components/metrics/metrics_log.h"
-#include "components/metrics/proto/omnibox_event.pb.h"
-#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "content/public/browser/notification_service.h"
using metrics::OmniboxEventProto;
namespace {
+
+OmniboxEventProto::InputType AsOmniboxEventInputType(
+ AutocompleteInput::Type type) {
+ switch (type) {
+ case AutocompleteInput::INVALID:
+ return OmniboxEventProto::INVALID;
+ case AutocompleteInput::UNKNOWN:
+ return OmniboxEventProto::UNKNOWN;
+ case AutocompleteInput::URL:
+ return OmniboxEventProto::URL;
+ case AutocompleteInput::QUERY:
+ return OmniboxEventProto::QUERY;
+ case AutocompleteInput::FORCED_QUERY:
+ return OmniboxEventProto::FORCED_QUERY;
+ }
+ NOTREACHED();
+ return OmniboxEventProto::INVALID;
+}
OmniboxEventProto::Suggestion::ResultType AsOmniboxEventResultType(
AutocompleteMatch::Type type) {
@@ -166,7 +182,7 @@
}
omnibox_event->set_current_page_classification(
AsOmniboxEventPageClassification(log.current_page_classification));
- omnibox_event->set_input_type(log.input_type);
+ omnibox_event->set_input_type(AsOmniboxEventInputType(log.input_type));
// We consider a paste-and-search/paste-and-go action to have a closed popup
// (as explained in omnibox_event.proto) even if it was not, because such
// actions ignore the contents of the popup so it doesn't matter that it was
« no previous file with comments | « chrome/browser/autocomplete/zero_suggest_provider.cc ('k') | chrome/browser/omnibox/omnibox_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698