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

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

Issue 20747002: Make a copy of PageClassification enum outside the metrics code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ilya's comment Created 7 years, 5 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/autocomplete_input.h ('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/metrics_log.cc
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index af2613f17215b1fac0c165226a14b67c0cbbfafa..db64070cb808c251f2ae1003a4dfb6af27cbeb16 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -141,6 +141,28 @@ OmniboxEventProto::Suggestion::ResultType AsOmniboxEventResultType(
}
}
+OmniboxEventProto::PageClassification AsOmniboxEventPageClassification(
+ AutocompleteInput::PageClassification page_classification) {
+ switch (page_classification) {
+ case AutocompleteInput::INVALID_SPEC:
+ return OmniboxEventProto::INVALID_SPEC;
+ case AutocompleteInput::NEW_TAB_PAGE:
+ return OmniboxEventProto::NEW_TAB_PAGE;
+ case AutocompleteInput::BLANK:
+ return OmniboxEventProto::BLANK;
+ case AutocompleteInput::HOMEPAGE:
+ return OmniboxEventProto::HOMEPAGE;
+ case AutocompleteInput::OTHER:
+ return OmniboxEventProto::OTHER;
+ case AutocompleteInput::INSTANT_NEW_TAB_PAGE:
+ return OmniboxEventProto::INSTANT_NEW_TAB_PAGE;
+ case AutocompleteInput::SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT:
+ return OmniboxEventProto::
+ SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT;
+ }
+ return OmniboxEventProto::INVALID_SPEC;
+}
+
ProfilerEventProto::TrackedObject::ProcessType AsProtobufProcessType(
int process_type) {
switch (process_type) {
@@ -829,7 +851,7 @@ void MetricsLog::RecordOmniboxOpenedURL(const OmniboxLog& log) {
omnibox_event->set_duration_since_last_default_match_update_ms(
log.elapsed_time_since_last_change_to_default_match.InMilliseconds());
omnibox_event->set_current_page_classification(
- log.current_page_classification);
+ AsOmniboxEventPageClassification(log.current_page_classification));
omnibox_event->set_input_type(AsOmniboxEventInputType(log.input_type));
for (AutocompleteResult::const_iterator i(log.result.begin());
i != log.result.end(); ++i) {
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_input.h ('k') | chrome/browser/omnibox/omnibox_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698