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 11 matching lines...) Expand all Loading... |
22 #include "base/tracked_objects.h" | 22 #include "base/tracked_objects.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "chrome/browser/autocomplete/autocomplete_input.h" | 24 #include "chrome/browser/autocomplete/autocomplete_input.h" |
25 #include "chrome/browser/autocomplete/autocomplete_log.h" | 25 #include "chrome/browser/autocomplete/autocomplete_log.h" |
26 #include "chrome/browser/autocomplete/autocomplete_match.h" | 26 #include "chrome/browser/autocomplete/autocomplete_match.h" |
27 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 27 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
28 #include "chrome/browser/autocomplete/autocomplete_result.h" | 28 #include "chrome/browser/autocomplete/autocomplete_result.h" |
29 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
30 #include "chrome/browser/google/google_util.h" | 30 #include "chrome/browser/google/google_util.h" |
31 #include "chrome/browser/plugins/plugin_prefs.h" | 31 #include "chrome/browser/plugins/plugin_prefs.h" |
| 32 #include "chrome/browser/prefs/pref_registry_simple.h" |
32 #include "chrome/browser/prefs/pref_service.h" | 33 #include "chrome/browser/prefs/pref_service.h" |
33 #include "chrome/browser/profiles/profile_manager.h" | 34 #include "chrome/browser/profiles/profile_manager.h" |
34 #include "chrome/common/chrome_version_info.h" | 35 #include "chrome/common/chrome_version_info.h" |
35 #include "chrome/common/logging_chrome.h" | 36 #include "chrome/common/logging_chrome.h" |
36 #include "chrome/common/metrics/proto/omnibox_event.pb.h" | 37 #include "chrome/common/metrics/proto/omnibox_event.pb.h" |
37 #include "chrome/common/metrics/proto/profiler_event.pb.h" | 38 #include "chrome/common/metrics/proto/profiler_event.pb.h" |
38 #include "chrome/common/metrics/proto/system_profile.pb.h" | 39 #include "chrome/common/metrics/proto/system_profile.pb.h" |
39 #include "chrome/common/metrics/variations/variations_util.h" | 40 #include "chrome/common/metrics/variations/variations_util.h" |
40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
41 #include "chrome/installer/util/google_update_settings.h" | 42 #include "chrome/installer/util/google_update_settings.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 static base::LazyInstance<std::string>::Leaky | 373 static base::LazyInstance<std::string>::Leaky |
373 g_version_extension = LAZY_INSTANCE_INITIALIZER; | 374 g_version_extension = LAZY_INSTANCE_INITIALIZER; |
374 | 375 |
375 MetricsLog::MetricsLog(const std::string& client_id, int session_id) | 376 MetricsLog::MetricsLog(const std::string& client_id, int session_id) |
376 : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()), | 377 : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()), |
377 network_observer_(new NetworkObserver()) {} | 378 network_observer_(new NetworkObserver()) {} |
378 | 379 |
379 MetricsLog::~MetricsLog() {} | 380 MetricsLog::~MetricsLog() {} |
380 | 381 |
381 // static | 382 // static |
382 void MetricsLog::RegisterPrefs(PrefServiceSimple* local_state) { | 383 void MetricsLog::RegisterPrefs(PrefRegistrySimple* local_state) { |
383 local_state->RegisterListPref(prefs::kStabilityPluginStats); | 384 local_state->RegisterListPref(prefs::kStabilityPluginStats); |
384 } | 385 } |
385 | 386 |
386 // static | 387 // static |
387 int64 MetricsLog::GetIncrementalUptime(PrefService* pref) { | 388 int64 MetricsLog::GetIncrementalUptime(PrefService* pref) { |
388 base::TimeTicks now = base::TimeTicks::Now(); | 389 base::TimeTicks now = base::TimeTicks::Now(); |
389 static base::TimeTicks last_updated_time(now); | 390 static base::TimeTicks last_updated_time(now); |
390 int64 incremental_time = (now - last_updated_time).InSeconds(); | 391 int64 incremental_time = (now - last_updated_time).InSeconds(); |
391 last_updated_time = now; | 392 last_updated_time = now; |
392 | 393 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 ProductDataToProto(google_update_metrics.google_update_data, | 1137 ProductDataToProto(google_update_metrics.google_update_data, |
1137 google_update->mutable_google_update_status()); | 1138 google_update->mutable_google_update_status()); |
1138 } | 1139 } |
1139 | 1140 |
1140 if (!google_update_metrics.product_data.version.empty()) { | 1141 if (!google_update_metrics.product_data.version.empty()) { |
1141 ProductDataToProto(google_update_metrics.product_data, | 1142 ProductDataToProto(google_update_metrics.product_data, |
1142 google_update->mutable_client_status()); | 1143 google_update->mutable_client_status()); |
1143 } | 1144 } |
1144 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) | 1145 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) |
1145 } | 1146 } |
OLD | NEW |