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 |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 struct WebPluginInfo; | 37 struct WebPluginInfo; |
38 } | 38 } |
39 | 39 |
40 namespace tracked_objects { | 40 namespace tracked_objects { |
41 struct ProcessDataSnapshot; | 41 struct ProcessDataSnapshot; |
42 } | 42 } |
43 | 43 |
44 namespace chrome_variations { | 44 namespace variations { |
45 struct ActiveGroupId; | 45 struct ActiveGroupId; |
46 } | 46 } |
47 | 47 |
48 // This is a small helper struct to pass Google Update metrics in a single | 48 // This is a small helper struct to pass Google Update metrics in a single |
49 // reference argument to MetricsLog::RecordEnvironment(). | 49 // reference argument to MetricsLog::RecordEnvironment(). |
50 struct GoogleUpdateMetrics { | 50 struct GoogleUpdateMetrics { |
51 GoogleUpdateMetrics(); | 51 GoogleUpdateMetrics(); |
52 ~GoogleUpdateMetrics(); | 52 ~GoogleUpdateMetrics(); |
53 | 53 |
54 // Defines whether this is a user-level or system-level install. | 54 // Defines whether this is a user-level or system-level install. |
(...skipping 29 matching lines...) Expand all Loading... |
84 | 84 |
85 // Records the current operating environment. Takes the list of installed | 85 // Records the current operating environment. Takes the list of installed |
86 // plugins, Google Update statistics, and synthetic trial IDs as parameters | 86 // plugins, Google Update statistics, and synthetic trial IDs as parameters |
87 // because those can't be obtained synchronously from the UI thread. | 87 // because those can't be obtained synchronously from the UI thread. |
88 // A synthetic trial is one that is set up dynamically by code in Chrome. For | 88 // A synthetic trial is one that is set up dynamically by code in Chrome. For |
89 // example, a pref may be mapped to a synthetic trial such that the group | 89 // example, a pref may be mapped to a synthetic trial such that the group |
90 // is determined by the pref value. | 90 // is determined by the pref value. |
91 void RecordEnvironment( | 91 void RecordEnvironment( |
92 const std::vector<content::WebPluginInfo>& plugin_list, | 92 const std::vector<content::WebPluginInfo>& plugin_list, |
93 const GoogleUpdateMetrics& google_update_metrics, | 93 const GoogleUpdateMetrics& google_update_metrics, |
94 const std::vector<chrome_variations::ActiveGroupId>& synthetic_trials); | 94 const std::vector<variations::ActiveGroupId>& synthetic_trials); |
95 | 95 |
96 // Loads the environment proto that was saved by the last RecordEnvironment() | 96 // Loads the environment proto that was saved by the last RecordEnvironment() |
97 // call from prefs and clears the pref value. Returns true on success or false | 97 // call from prefs and clears the pref value. Returns true on success or false |
98 // if there was no saved environment in prefs or it could not be decoded. | 98 // if there was no saved environment in prefs or it could not be decoded. |
99 bool LoadSavedEnvironmentFromPrefs(); | 99 bool LoadSavedEnvironmentFromPrefs(); |
100 | 100 |
101 // Records the input text, available choices, and selected entry when the | 101 // Records the input text, available choices, and selected entry when the |
102 // user uses the Omnibox to open a URL. | 102 // user uses the Omnibox to open a URL. |
103 void RecordOmniboxOpenedURL(const OmniboxLog& log); | 103 void RecordOmniboxOpenedURL(const OmniboxLog& log); |
104 | 104 |
(...skipping 29 matching lines...) Expand all Loading... |
134 | 134 |
135 // Returns the device scale factor for the primary monitor. | 135 // Returns the device scale factor for the primary monitor. |
136 virtual float GetScreenDeviceScaleFactor() const; | 136 virtual float GetScreenDeviceScaleFactor() const; |
137 | 137 |
138 // Returns the number of monitors the user is using. | 138 // Returns the number of monitors the user is using. |
139 virtual int GetScreenCount() const; | 139 virtual int GetScreenCount() const; |
140 | 140 |
141 // Fills |field_trial_ids| with the list of initialized field trials name and | 141 // Fills |field_trial_ids| with the list of initialized field trials name and |
142 // group ids. | 142 // group ids. |
143 virtual void GetFieldTrialIds( | 143 virtual void GetFieldTrialIds( |
144 std::vector<chrome_variations::ActiveGroupId>* field_trial_ids) const; | 144 std::vector<variations::ActiveGroupId>* field_trial_ids) const; |
145 | 145 |
146 // Exposed to allow dependency injection for tests. | 146 // Exposed to allow dependency injection for tests. |
147 #if defined(OS_CHROMEOS) | 147 #if defined(OS_CHROMEOS) |
148 scoped_ptr<MetricsLogChromeOS> metrics_log_chromeos_; | 148 scoped_ptr<MetricsLogChromeOS> metrics_log_chromeos_; |
149 #endif | 149 #endif |
150 | 150 |
151 private: | 151 private: |
152 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); | 152 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
153 | 153 |
154 // Returns true if the environment has already been filled in by a call to | 154 // Returns true if the environment has already been filled in by a call to |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // The time when the current log was created. | 186 // The time when the current log was created. |
187 const base::TimeTicks creation_time_; | 187 const base::TimeTicks creation_time_; |
188 | 188 |
189 // For including information on which extensions are installed in reports. | 189 // For including information on which extensions are installed in reports. |
190 HashedExtensionMetrics extension_metrics_; | 190 HashedExtensionMetrics extension_metrics_; |
191 | 191 |
192 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 192 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
193 }; | 193 }; |
194 | 194 |
195 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 195 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |