summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authormpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-08 00:02:22 +0000
committermpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-08 00:02:22 +0000
commit3dc75b1cccf30ccce1f13553353c21c21d6a3e34 (patch)
tree2ae602d45cb7006f3dffe30cc8c9d43038b0b5df /components
parent702484bde5a044d224230f08ea12aeeb7cd069d6 (diff)
downloadchromium_src-3dc75b1cccf30ccce1f13553353c21c21d6a3e34.zip
chromium_src-3dc75b1cccf30ccce1f13553353c21c21d6a3e34.tar.gz
chromium_src-3dc75b1cccf30ccce1f13553353c21c21d6a3e34.tar.bz2
Omnibox: Combine Two Input Type Enums into One
There are two input type enums: * one in the autocomplete code * one in the metrics code that's used for UMA logging; this one is meant to remain stable As part of fixing the linked bug, I created https://codereview.chromium.org/314773002/ whch needed an input type enum, one which would remain stable. It didn't necessarily have to be the metrics enum. After discussion with the UMA folks (who deal with how to handle stable enum problems all the time), we reached the conclusion that we should have one stable enum and use it everywhere. That's the cleanest answer. This single enum has to live in the metrics directory because metrics is a component. This change combines the two existing enums into one, putting the new enum in a new file in the metrics directory. The reason for a new file is so we can include it without include the whole OmniboxEventProto or any other metrics code. The main files to review are autocomplete_input.h and *.proto. All other changes are a mechanical result of the changes in those three files. The internal proto change has been submitted. TBR=stevenjb for the trivial change to chrome/browser/ui/app_list/search/omnibox_provider.cc that removes an unnecessary include BUG=284781 NOTRY=True Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275696 Review URL: https://codereview.chromium.org/319523005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/metrics.gypi1
-rw-r--r--components/metrics/proto/omnibox_event.proto15
-rw-r--r--components/metrics/proto/omnibox_input_type.proto37
3 files changed, 41 insertions, 12 deletions
diff --git a/components/metrics.gypi b/components/metrics.gypi
index b9d4420..0a48dac 100644
--- a/components/metrics.gypi
+++ b/components/metrics.gypi
@@ -83,6 +83,7 @@
'metrics/proto/chrome_user_metrics_extension.proto',
'metrics/proto/histogram_event.proto',
'metrics/proto/omnibox_event.proto',
+ 'metrics/proto/omnibox_input_type.proto',
'metrics/proto/perf_data.proto',
'metrics/proto/profiler_event.proto',
'metrics/proto/sampled_profile.proto',
diff --git a/components/metrics/proto/omnibox_event.proto b/components/metrics/proto/omnibox_event.proto
index 3307954..afef1a0 100644
--- a/components/metrics/proto/omnibox_event.proto
+++ b/components/metrics/proto/omnibox_event.proto
@@ -10,6 +10,8 @@ option optimize_for = LITE_RUNTIME;
package metrics;
+import "omnibox_input_type.proto";
+
// Next tag: 17
message OmniboxEventProto {
// The timestamp for the event, in seconds since the epoch.
@@ -130,18 +132,7 @@ message OmniboxEventProto {
}
optional PageClassification current_page_classification = 10;
- // What kind of input the user provided.
- enum InputType {
- INVALID = 0; // Empty input (should not reach here)
- UNKNOWN = 1; // Valid input whose type cannot be determined
- REQUESTED_URL = 2; // DEPRECATED. Input autodetected as UNKNOWN, which the
- // user wants to treat as an URL by specifying a
- // desired_tld
- URL = 3; // Input autodetected as a URL
- QUERY = 4; // Input autodetected as a query
- FORCED_QUERY = 5; // Input forced to be a query by an initial '?'
- }
- optional InputType input_type = 8;
+ optional OmniboxInputType.Type input_type = 8;
// An enum used in multiple places below.
enum ProviderType {
diff --git a/components/metrics/proto/omnibox_input_type.proto b/components/metrics/proto/omnibox_input_type.proto
new file mode 100644
index 0000000..6a9b08e
--- /dev/null
+++ b/components/metrics/proto/omnibox_input_type.proto
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Stores information about an omnibox interaction.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package metrics.OmniboxInputType;
+
+// What kind of input the user provided.
+// Note that the type below may be misleading. For example, "http:/" alone
+// cannot be opened as a URL, so it is marked as a QUERY; yet the user
+// probably intends to type more and have it eventually become a URL, so we
+// need to make sure we still run it through inline autocomplete.
+enum Type {
+ // Empty input (should not reach here)
+ INVALID = 0;
+
+ // Valid input whose type cannot be determined
+ UNKNOWN = 1;
+
+ // DEPRECATED. Input autodetected as UNKNOWN, which the user wants to treat
+ // as an URL by specifying a desired_tld.
+ DEPRECATED_REQUESTED_URL = 2;
+
+ // Input autodetected as a URL
+ URL = 3;
+
+ // Input autodetected as a query
+ QUERY = 4;
+
+ // Input forced to be a query by an initial '?'
+ FORCED_QUERY = 5;
+}