| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/metrics/omnibox_metrics_provider.h" | 5 #include "chrome/browser/metrics/omnibox_metrics_provider.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "chrome/browser/autocomplete/autocomplete_result.h" | |
| 13 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/omnibox/omnibox_log.h" | 13 #include "chrome/browser/omnibox/omnibox_log.h" |
| 15 #include "chrome/browser/ui/browser_otr_state.h" | 14 #include "chrome/browser/ui/browser_otr_state.h" |
| 16 #include "components/metrics/metrics_log.h" | 15 #include "components/metrics/metrics_log.h" |
| 17 #include "components/metrics/proto/omnibox_event.pb.h" | 16 #include "components/metrics/proto/omnibox_event.pb.h" |
| 18 #include "components/metrics/proto/omnibox_input_type.pb.h" | 17 #include "components/metrics/proto/omnibox_input_type.pb.h" |
| 19 #include "components/omnibox/autocomplete_match.h" | 18 #include "components/omnibox/autocomplete_match.h" |
| 20 #include "components/omnibox/autocomplete_provider.h" | 19 #include "components/omnibox/autocomplete_provider.h" |
| 20 #include "components/omnibox/autocomplete_result.h" |
| 21 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
| 22 | 22 |
| 23 using metrics::OmniboxEventProto; | 23 using metrics::OmniboxEventProto; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 OmniboxEventProto::Suggestion::ResultType AsOmniboxEventResultType( | 27 OmniboxEventProto::Suggestion::ResultType AsOmniboxEventResultType( |
| 28 AutocompleteMatch::Type type) { | 28 AutocompleteMatch::Type type) { |
| 29 switch (type) { | 29 switch (type) { |
| 30 case AutocompleteMatchType::URL_WHAT_YOU_TYPED: | 30 case AutocompleteMatchType::URL_WHAT_YOU_TYPED: |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (i->typed_count != -1) | 161 if (i->typed_count != -1) |
| 162 suggestion->set_typed_count(i->typed_count); | 162 suggestion->set_typed_count(i->typed_count); |
| 163 } | 163 } |
| 164 for (ProvidersInfo::const_iterator i(log.providers_info.begin()); | 164 for (ProvidersInfo::const_iterator i(log.providers_info.begin()); |
| 165 i != log.providers_info.end(); ++i) { | 165 i != log.providers_info.end(); ++i) { |
| 166 OmniboxEventProto::ProviderInfo* provider_info = | 166 OmniboxEventProto::ProviderInfo* provider_info = |
| 167 omnibox_event->add_provider_info(); | 167 omnibox_event->add_provider_info(); |
| 168 provider_info->CopyFrom(*i); | 168 provider_info->CopyFrom(*i); |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |