OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 base::TimeDelta::FromMilliseconds(-1)) { | 853 base::TimeDelta::FromMilliseconds(-1)) { |
854 // Only upload the typing duration if it is set/valid. | 854 // Only upload the typing duration if it is set/valid. |
855 omnibox_event->set_typing_duration_ms( | 855 omnibox_event->set_typing_duration_ms( |
856 log.elapsed_time_since_user_first_modified_omnibox.InMilliseconds()); | 856 log.elapsed_time_since_user_first_modified_omnibox.InMilliseconds()); |
857 } | 857 } |
858 omnibox_event->set_duration_since_last_default_match_update_ms( | 858 omnibox_event->set_duration_since_last_default_match_update_ms( |
859 log.elapsed_time_since_last_change_to_default_match.InMilliseconds()); | 859 log.elapsed_time_since_last_change_to_default_match.InMilliseconds()); |
860 omnibox_event->set_current_page_classification( | 860 omnibox_event->set_current_page_classification( |
861 AsOmniboxEventPageClassification(log.current_page_classification)); | 861 AsOmniboxEventPageClassification(log.current_page_classification)); |
862 omnibox_event->set_input_type(AsOmniboxEventInputType(log.input_type)); | 862 omnibox_event->set_input_type(AsOmniboxEventInputType(log.input_type)); |
863 | |
864 // The view code to hide the top result is currently only implemented on the | |
865 // Mac and for views. | |
866 #if defined(OS_MACOSX) || defined(TOOLKIT_VIEWS) | |
867 omnibox_event->set_is_top_result_hidden_in_dropdown( | 863 omnibox_event->set_is_top_result_hidden_in_dropdown( |
868 log.result.ShouldHideTopMatch()); | 864 log.result.ShouldHideTopMatch()); |
869 #endif // defined(OS_MACOSX) || defined(TOOLKIT_VIEWS) | |
870 | 865 |
871 for (AutocompleteResult::const_iterator i(log.result.begin()); | 866 for (AutocompleteResult::const_iterator i(log.result.begin()); |
872 i != log.result.end(); ++i) { | 867 i != log.result.end(); ++i) { |
873 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion(); | 868 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion(); |
874 suggestion->set_provider(i->provider->AsOmniboxEventProviderType()); | 869 suggestion->set_provider(i->provider->AsOmniboxEventProviderType()); |
875 suggestion->set_result_type(AsOmniboxEventResultType(i->type)); | 870 suggestion->set_result_type(AsOmniboxEventResultType(i->type)); |
876 suggestion->set_relevance(i->relevance); | 871 suggestion->set_relevance(i->relevance); |
877 if (i->typed_count != -1) | 872 if (i->typed_count != -1) |
878 suggestion->set_typed_count(i->typed_count); | 873 suggestion->set_typed_count(i->typed_count); |
879 suggestion->set_is_starred(i->starred); | 874 suggestion->set_is_starred(i->starred); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 | 950 |
956 paired_device->set_vendor_prefix(vendor_prefix); | 951 paired_device->set_vendor_prefix(vendor_prefix); |
957 } | 952 } |
958 | 953 |
959 paired_device->set_vendor_id(device->GetVendorID()); | 954 paired_device->set_vendor_id(device->GetVendorID()); |
960 paired_device->set_product_id(device->GetProductID()); | 955 paired_device->set_product_id(device->GetProductID()); |
961 paired_device->set_device_id(device->GetDeviceID()); | 956 paired_device->set_device_id(device->GetDeviceID()); |
962 } | 957 } |
963 #endif // defined(OS_CHROMEOS) | 958 #endif // defined(OS_CHROMEOS) |
964 } | 959 } |
OLD | NEW |