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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 // For the remaining calls, re-use the existing field. | 805 // For the remaining calls, re-use the existing field. |
806 profile = uma_proto()->mutable_profiler_event(0); | 806 profile = uma_proto()->mutable_profiler_event(0); |
807 } | 807 } |
808 | 808 |
809 WriteProfilerData(process_data, process_type, profile); | 809 WriteProfilerData(process_data, process_type, profile); |
810 } | 810 } |
811 | 811 |
812 void MetricsLog::RecordOmniboxOpenedURL(const OmniboxLog& log) { | 812 void MetricsLog::RecordOmniboxOpenedURL(const OmniboxLog& log) { |
813 DCHECK(!locked()); | 813 DCHECK(!locked()); |
814 | 814 |
815 std::vector<string16> terms; | 815 std::vector<base::string16> terms; |
816 const int num_terms = | 816 const int num_terms = |
817 static_cast<int>(Tokenize(log.text, kWhitespaceUTF16, &terms)); | 817 static_cast<int>(Tokenize(log.text, base::kWhitespaceUTF16, &terms)); |
818 | 818 |
819 OmniboxEventProto* omnibox_event = uma_proto()->add_omnibox_event(); | 819 OmniboxEventProto* omnibox_event = uma_proto()->add_omnibox_event(); |
820 omnibox_event->set_time(MetricsLogBase::GetCurrentTime()); | 820 omnibox_event->set_time(MetricsLogBase::GetCurrentTime()); |
821 if (log.tab_id != -1) { | 821 if (log.tab_id != -1) { |
822 // If we know what tab the autocomplete URL was opened in, log it. | 822 // If we know what tab the autocomplete URL was opened in, log it. |
823 omnibox_event->set_tab_id(log.tab_id); | 823 omnibox_event->set_tab_id(log.tab_id); |
824 } | 824 } |
825 omnibox_event->set_typed_length(log.text.length()); | 825 omnibox_event->set_typed_length(log.text.length()); |
826 omnibox_event->set_just_deleted_text(log.just_deleted_text); | 826 omnibox_event->set_just_deleted_text(log.just_deleted_text); |
827 omnibox_event->set_num_typed_terms(num_terms); | 827 omnibox_event->set_num_typed_terms(num_terms); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 | 947 |
948 // We invalidate the user count if it changed while the log was open. | 948 // We invalidate the user count if it changed while the log was open. |
949 if (system_profile->has_multi_profile_user_count() && | 949 if (system_profile->has_multi_profile_user_count() && |
950 user_count != system_profile->multi_profile_user_count()) | 950 user_count != system_profile->multi_profile_user_count()) |
951 user_count = 0; | 951 user_count = 0; |
952 | 952 |
953 system_profile->set_multi_profile_user_count(user_count); | 953 system_profile->set_multi_profile_user_count(user_count); |
954 } | 954 } |
955 } | 955 } |
956 #endif | 956 #endif |
OLD | NEW |