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 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/metrics/field_trial.h" | |
17 #include "chrome/common/metrics/metrics_log_base.h" | 16 #include "chrome/common/metrics/metrics_log_base.h" |
18 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
19 | 18 |
20 struct AutocompleteLog; | 19 struct AutocompleteLog; |
21 class PrefService; | 20 class PrefService; |
22 | 21 |
23 namespace base { | 22 namespace base { |
24 class DictionaryValue; | 23 class DictionaryValue; |
25 } | 24 } |
26 | 25 |
| 26 namespace experiments_helper { |
| 27 struct NameGroupId; |
| 28 } |
| 29 |
27 namespace webkit { | 30 namespace webkit { |
28 struct WebPluginInfo; | 31 struct WebPluginInfo; |
29 } | 32 } |
30 | 33 |
31 class MetricsLog : public MetricsLogBase { | 34 class MetricsLog : public MetricsLogBase { |
32 public: | 35 public: |
33 // Creates a new metrics log | 36 // Creates a new metrics log |
34 // client_id is the identifier for this profile on this installation | 37 // client_id is the identifier for this profile on this installation |
35 // session_id is an integer that's incremented on each application launch | 38 // session_id is an integer that's incremented on each application launch |
36 MetricsLog(const std::string& client_id, int session_id); | 39 MetricsLog(const std::string& client_id, int session_id); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 92 |
90 // Returns the screen size for the primary monitor. | 93 // Returns the screen size for the primary monitor. |
91 virtual gfx::Size GetScreenSize() const; | 94 virtual gfx::Size GetScreenSize() const; |
92 | 95 |
93 // Returns the number of monitors the user is using. | 96 // Returns the number of monitors the user is using. |
94 virtual int GetScreenCount() const; | 97 virtual int GetScreenCount() const; |
95 | 98 |
96 // Fills |field_trial_ids| with the list of initialized field trials name and | 99 // Fills |field_trial_ids| with the list of initialized field trials name and |
97 // group ids. | 100 // group ids. |
98 virtual void GetFieldTrialIds( | 101 virtual void GetFieldTrialIds( |
99 std::vector<base::FieldTrial::NameGroupId>* field_trial_ids) const; | 102 std::vector<experiments_helper::NameGroupId>* field_trial_ids) const; |
100 | 103 |
101 private: | 104 private: |
102 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); | 105 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
103 | 106 |
104 // Writes application stability metrics (as part of the profile log). | 107 // Writes application stability metrics (as part of the profile log). |
105 // NOTE: Has the side-effect of clearing those counts. | 108 // NOTE: Has the side-effect of clearing those counts. |
106 void WriteStabilityElement( | 109 void WriteStabilityElement( |
107 const std::vector<webkit::WebPluginInfo>& plugin_list, | 110 const std::vector<webkit::WebPluginInfo>& plugin_list, |
108 PrefService* pref); | 111 PrefService* pref); |
109 | 112 |
(...skipping 27 matching lines...) Expand all Loading... |
137 | 140 |
138 // Writes metrics for the profile identified by key. This writes all | 141 // Writes metrics for the profile identified by key. This writes all |
139 // key/value pairs in profile_metrics. | 142 // key/value pairs in profile_metrics. |
140 void WriteProfileMetrics(const std::string& key, | 143 void WriteProfileMetrics(const std::string& key, |
141 const base::DictionaryValue& profile_metrics); | 144 const base::DictionaryValue& profile_metrics); |
142 | 145 |
143 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 146 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
144 }; | 147 }; |
145 | 148 |
146 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 149 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |