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 13 matching lines...) Expand all Loading... |
24 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
25 #include "base/third_party/nspr/prtime.h" | 25 #include "base/third_party/nspr/prtime.h" |
26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
27 #include "base/tracked_objects.h" | 27 #include "base/tracked_objects.h" |
28 #include "chrome/browser/autocomplete/autocomplete_input.h" | 28 #include "chrome/browser/autocomplete/autocomplete_input.h" |
29 #include "chrome/browser/autocomplete/autocomplete_match.h" | 29 #include "chrome/browser/autocomplete/autocomplete_match.h" |
30 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 30 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
31 #include "chrome/browser/autocomplete/autocomplete_result.h" | 31 #include "chrome/browser/autocomplete/autocomplete_result.h" |
32 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
33 #include "chrome/browser/google/google_util.h" | 33 #include "chrome/browser/google/google_util.h" |
34 #include "chrome/browser/metrics/extension_metrics.h" | |
35 #include "chrome/browser/omnibox/omnibox_log.h" | 34 #include "chrome/browser/omnibox/omnibox_log.h" |
36 #include "chrome/browser/plugins/plugin_prefs.h" | 35 #include "chrome/browser/plugins/plugin_prefs.h" |
37 #include "chrome/browser/profiles/profile_manager.h" | 36 #include "chrome/browser/profiles/profile_manager.h" |
38 #include "chrome/common/chrome_version_info.h" | 37 #include "chrome/common/chrome_version_info.h" |
39 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
40 #include "chrome/installer/util/google_update_settings.h" | 39 #include "chrome/installer/util/google_update_settings.h" |
41 #include "components/metrics/metrics_provider.h" | 40 #include "components/metrics/metrics_provider.h" |
42 #include "components/metrics/proto/omnibox_event.pb.h" | 41 #include "components/metrics/proto/omnibox_event.pb.h" |
43 #include "components/metrics/proto/profiler_event.pb.h" | 42 #include "components/metrics/proto/profiler_event.pb.h" |
44 #include "components/metrics/proto/system_profile.pb.h" | 43 #include "components/metrics/proto/system_profile.pb.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 GoogleUpdateMetrics::GoogleUpdateMetrics() : is_system_install(false) {} | 396 GoogleUpdateMetrics::GoogleUpdateMetrics() : is_system_install(false) {} |
398 | 397 |
399 GoogleUpdateMetrics::~GoogleUpdateMetrics() {} | 398 GoogleUpdateMetrics::~GoogleUpdateMetrics() {} |
400 | 399 |
401 static base::LazyInstance<std::string>::Leaky | 400 static base::LazyInstance<std::string>::Leaky |
402 g_version_extension = LAZY_INSTANCE_INITIALIZER; | 401 g_version_extension = LAZY_INSTANCE_INITIALIZER; |
403 | 402 |
404 MetricsLog::MetricsLog(const std::string& client_id, | 403 MetricsLog::MetricsLog(const std::string& client_id, |
405 int session_id, | 404 int session_id, |
406 LogType log_type) | 405 LogType log_type) |
407 : MetricsLogBase(client_id, session_id, log_type, | 406 : MetricsLogBase(client_id, |
| 407 session_id, |
| 408 log_type, |
408 MetricsLog::GetVersionString()), | 409 MetricsLog::GetVersionString()), |
409 creation_time_(base::TimeTicks::Now()), | 410 creation_time_(base::TimeTicks::Now()) { |
410 extension_metrics_(uma_proto()->client_id()) { | |
411 uma_proto()->mutable_system_profile()->set_channel( | 411 uma_proto()->mutable_system_profile()->set_channel( |
412 AsProtobufChannel(chrome::VersionInfo::GetChannel())); | 412 AsProtobufChannel(chrome::VersionInfo::GetChannel())); |
413 | 413 |
414 #if defined(OS_CHROMEOS) | 414 #if defined(OS_CHROMEOS) |
415 metrics_log_chromeos_.reset(new MetricsLogChromeOS(uma_proto())); | 415 metrics_log_chromeos_.reset(new MetricsLogChromeOS(uma_proto())); |
416 #endif // OS_CHROMEOS | 416 #endif // OS_CHROMEOS |
417 } | 417 } |
418 | 418 |
419 MetricsLog::~MetricsLog() {} | 419 MetricsLog::~MetricsLog() {} |
420 | 420 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor()); | 790 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor()); |
791 hardware->set_screen_count(GetScreenCount()); | 791 hardware->set_screen_count(GetScreenCount()); |
792 | 792 |
793 #if defined(OS_WIN) | 793 #if defined(OS_WIN) |
794 WriteScreenDPIInformationProto(hardware); | 794 WriteScreenDPIInformationProto(hardware); |
795 #endif | 795 #endif |
796 | 796 |
797 WriteGoogleUpdateProto(google_update_metrics); | 797 WriteGoogleUpdateProto(google_update_metrics); |
798 | 798 |
799 WritePluginList(plugin_list); | 799 WritePluginList(plugin_list); |
800 extension_metrics_.WriteExtensionList(uma_proto()->mutable_system_profile()); | |
801 | 800 |
802 std::vector<ActiveGroupId> field_trial_ids; | 801 std::vector<ActiveGroupId> field_trial_ids; |
803 GetFieldTrialIds(&field_trial_ids); | 802 GetFieldTrialIds(&field_trial_ids); |
804 WriteFieldTrials(field_trial_ids, system_profile); | 803 WriteFieldTrials(field_trial_ids, system_profile); |
805 WriteFieldTrials(synthetic_trials, system_profile); | 804 WriteFieldTrials(synthetic_trials, system_profile); |
806 | 805 |
807 #if defined(OS_CHROMEOS) | 806 #if defined(OS_CHROMEOS) |
808 metrics_log_chromeos_->LogChromeOSMetrics(); | 807 metrics_log_chromeos_->LogChromeOSMetrics(); |
809 #endif // OS_CHROMEOS | 808 #endif // OS_CHROMEOS |
810 | 809 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 ProductDataToProto(google_update_metrics.google_update_data, | 953 ProductDataToProto(google_update_metrics.google_update_data, |
955 google_update->mutable_google_update_status()); | 954 google_update->mutable_google_update_status()); |
956 } | 955 } |
957 | 956 |
958 if (!google_update_metrics.product_data.version.empty()) { | 957 if (!google_update_metrics.product_data.version.empty()) { |
959 ProductDataToProto(google_update_metrics.product_data, | 958 ProductDataToProto(google_update_metrics.product_data, |
960 google_update->mutable_client_status()); | 959 google_update->mutable_client_status()); |
961 } | 960 } |
962 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) | 961 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) |
963 } | 962 } |
OLD | NEW |