| 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 // This file defines a set of user experience metrics data recorded by | 5 // This file defines a set of user experience metrics data recorded by |
| 6 // the MetricsService. This is the unit of data that is sent to the server. | 6 // the MetricsService. This is the unit of data that is sent to the server. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
| 9 #define CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "chrome/browser/metrics/metrics_network_observer.h" |
| 15 #include "chrome/common/metrics/metrics_log_base.h" | 16 #include "chrome/common/metrics/metrics_log_base.h" |
| 16 #include "chrome/installer/util/google_update_settings.h" | 17 #include "chrome/installer/util/google_update_settings.h" |
| 17 #include "content/public/common/process_type.h" | 18 #include "content/public/common/process_type.h" |
| 18 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
| 19 | 20 |
| 20 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
| 21 #include "chrome/browser/metrics/perf_provider_chromeos.h" | 22 #include "chrome/browser/metrics/perf_provider_chromeos.h" |
| 22 #endif | 23 #endif |
| 23 | 24 |
| 24 struct AutocompleteLog; | 25 struct AutocompleteLog; |
| 26 class MetricsNetworkObserver; |
| 25 class PrefService; | 27 class PrefService; |
| 26 class PrefRegistrySimple; | 28 class PrefRegistrySimple; |
| 27 | 29 |
| 28 namespace base { | 30 namespace base { |
| 29 class DictionaryValue; | 31 class DictionaryValue; |
| 30 } | 32 } |
| 31 | 33 |
| 32 namespace tracked_objects { | 34 namespace tracked_objects { |
| 33 struct ProcessDataSnapshot; | 35 struct ProcessDataSnapshot; |
| 34 } | 36 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 virtual int GetScreenCount() const; | 140 virtual int GetScreenCount() const; |
| 139 | 141 |
| 140 // Fills |field_trial_ids| with the list of initialized field trials name and | 142 // Fills |field_trial_ids| with the list of initialized field trials name and |
| 141 // group ids. | 143 // group ids. |
| 142 virtual void GetFieldTrialIds( | 144 virtual void GetFieldTrialIds( |
| 143 std::vector<chrome_variations::ActiveGroupId>* field_trial_ids) const; | 145 std::vector<chrome_variations::ActiveGroupId>* field_trial_ids) const; |
| 144 | 146 |
| 145 private: | 147 private: |
| 146 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); | 148 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
| 147 | 149 |
| 148 class NetworkObserver; | |
| 149 | |
| 150 // Writes application stability metrics (as part of the profile log). | 150 // Writes application stability metrics (as part of the profile log). |
| 151 // NOTE: Has the side-effect of clearing those counts. | 151 // NOTE: Has the side-effect of clearing those counts. |
| 152 void WriteStabilityElement( | 152 void WriteStabilityElement( |
| 153 const std::vector<webkit::WebPluginInfo>& plugin_list, | 153 const std::vector<webkit::WebPluginInfo>& plugin_list, |
| 154 PrefService* pref); | 154 PrefService* pref); |
| 155 | 155 |
| 156 // Within stability group, write plugin crash stats. | 156 // Within stability group, write plugin crash stats. |
| 157 void WritePluginStabilityElements( | 157 void WritePluginStabilityElements( |
| 158 const std::vector<webkit::WebPluginInfo>& plugin_list, | 158 const std::vector<webkit::WebPluginInfo>& plugin_list, |
| 159 PrefService* pref); | 159 PrefService* pref); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 183 | 183 |
| 184 // Writes metrics for the profile identified by key. This writes all | 184 // Writes metrics for the profile identified by key. This writes all |
| 185 // key/value pairs in profile_metrics. | 185 // key/value pairs in profile_metrics. |
| 186 void WriteProfileMetrics(const std::string& key, | 186 void WriteProfileMetrics(const std::string& key, |
| 187 const base::DictionaryValue& profile_metrics); | 187 const base::DictionaryValue& profile_metrics); |
| 188 | 188 |
| 189 // Writes info about the Google Update install that is managing this client. | 189 // Writes info about the Google Update install that is managing this client. |
| 190 // This is a no-op if called on a non-Windows platform. | 190 // This is a no-op if called on a non-Windows platform. |
| 191 void WriteGoogleUpdateProto(const GoogleUpdateMetrics& google_update_metrics); | 191 void WriteGoogleUpdateProto(const GoogleUpdateMetrics& google_update_metrics); |
| 192 | 192 |
| 193 // Registers as observer with net::NetworkChangeNotifier and keeps track of | 193 // Observes network state to provide values for SystemProfile::Network. |
| 194 // the network environment. | 194 MetricsNetworkObserver network_observer_; |
| 195 scoped_ptr<NetworkObserver> network_observer_; | 195 |
| 196 #if defined(OS_CHROMEOS) | 196 #if defined(OS_CHROMEOS) |
| 197 metrics::PerfProvider perf_provider_; | 197 metrics::PerfProvider perf_provider_; |
| 198 #endif | 198 #endif |
| 199 | 199 |
| 200 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 200 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 203 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
| OLD | NEW |