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/common/variations/variations_util.h" | 15 #include "chrome/common/variations/variations_util.h" |
16 #include "components/metrics/metrics_log_base.h" | 16 #include "components/metrics/metrics_log_base.h" |
17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
18 | 18 |
19 class PrefService; | 19 class PrefService; |
20 | 20 |
21 #if defined(OS_CHROMEOS) | |
22 class MetricsLogChromeOS; | |
23 #endif | |
24 | |
25 namespace base { | 21 namespace base { |
26 class DictionaryValue; | 22 class DictionaryValue; |
27 } | 23 } |
28 | 24 |
29 namespace content { | 25 namespace content { |
30 struct WebPluginInfo; | 26 struct WebPluginInfo; |
31 } | 27 } |
32 | 28 |
33 namespace metrics { | 29 namespace metrics { |
34 class MetricsProvider; | 30 class MetricsProvider; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Exposed for the sake of mocking in test code. | 102 // Exposed for the sake of mocking in test code. |
107 | 103 |
108 // Returns the PrefService from which to log metrics data. | 104 // Returns the PrefService from which to log metrics data. |
109 virtual PrefService* GetPrefService(); | 105 virtual PrefService* GetPrefService(); |
110 | 106 |
111 // Fills |field_trial_ids| with the list of initialized field trials name and | 107 // Fills |field_trial_ids| with the list of initialized field trials name and |
112 // group ids. | 108 // group ids. |
113 virtual void GetFieldTrialIds( | 109 virtual void GetFieldTrialIds( |
114 std::vector<variations::ActiveGroupId>* field_trial_ids) const; | 110 std::vector<variations::ActiveGroupId>* field_trial_ids) const; |
115 | 111 |
116 // Exposed to allow dependency injection for tests. | |
117 #if defined(OS_CHROMEOS) | |
118 scoped_ptr<MetricsLogChromeOS> metrics_log_chromeos_; | |
119 #endif | |
120 | |
121 private: | 112 private: |
122 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); | 113 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
123 | 114 |
124 // Returns true if the environment has already been filled in by a call to | 115 // Returns true if the environment has already been filled in by a call to |
125 // RecordEnvironment() or LoadSavedEnvironmentFromPrefs(). | 116 // RecordEnvironment() or LoadSavedEnvironmentFromPrefs(). |
126 bool HasEnvironment() const; | 117 bool HasEnvironment() const; |
127 | 118 |
128 // Returns true if the stability metrics have already been filled in by a | 119 // Returns true if the stability metrics have already been filled in by a |
129 // call to RecordStabilityMetrics(). | 120 // call to RecordStabilityMetrics(). |
130 bool HasStabilityMetrics() const; | 121 bool HasStabilityMetrics() const; |
(...skipping 13 matching lines...) Expand all Loading... |
144 // instance. | 135 // instance. |
145 metrics::MetricsServiceClient* const client_; | 136 metrics::MetricsServiceClient* const client_; |
146 | 137 |
147 // The time when the current log was created. | 138 // The time when the current log was created. |
148 const base::TimeTicks creation_time_; | 139 const base::TimeTicks creation_time_; |
149 | 140 |
150 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 141 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
151 }; | 142 }; |
152 | 143 |
153 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 144 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |