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 "content/public/common/process_type.h" | 17 #include "content/public/common/process_type.h" |
19 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
20 | 19 |
21 struct AutocompleteLog; | 20 struct AutocompleteLog; |
22 class PrefService; | 21 class PrefService; |
23 | 22 |
24 namespace base { | 23 namespace base { |
25 class DictionaryValue; | 24 class DictionaryValue; |
26 } | 25 } |
27 | 26 |
28 namespace tracked_objects { | 27 namespace tracked_objects { |
29 struct ProcessDataSnapshot; | 28 struct ProcessDataSnapshot; |
30 } | 29 } |
31 | 30 |
| 31 namespace experiments_helper { |
| 32 struct SelectedGroupId; |
| 33 } |
| 34 |
32 namespace webkit { | 35 namespace webkit { |
33 struct WebPluginInfo; | 36 struct WebPluginInfo; |
34 } | 37 } |
35 | 38 |
36 class MetricsLog : public MetricsLogBase { | 39 class MetricsLog : public MetricsLogBase { |
37 public: | 40 public: |
38 // Creates a new metrics log | 41 // Creates a new metrics log |
39 // client_id is the identifier for this profile on this installation | 42 // client_id is the identifier for this profile on this installation |
40 // session_id is an integer that's incremented on each application launch | 43 // session_id is an integer that's incremented on each application launch |
41 MetricsLog(const std::string& client_id, int session_id); | 44 MetricsLog(const std::string& client_id, int session_id); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 103 |
101 // Returns the screen size for the primary monitor. | 104 // Returns the screen size for the primary monitor. |
102 virtual gfx::Size GetScreenSize() const; | 105 virtual gfx::Size GetScreenSize() const; |
103 | 106 |
104 // Returns the number of monitors the user is using. | 107 // Returns the number of monitors the user is using. |
105 virtual int GetScreenCount() const; | 108 virtual int GetScreenCount() const; |
106 | 109 |
107 // Fills |field_trial_ids| with the list of initialized field trials name and | 110 // Fills |field_trial_ids| with the list of initialized field trials name and |
108 // group ids. | 111 // group ids. |
109 virtual void GetFieldTrialIds( | 112 virtual void GetFieldTrialIds( |
110 std::vector<base::FieldTrial::NameGroupId>* field_trial_ids) const; | 113 std::vector<experiments_helper::SelectedGroupId>* field_trial_ids) const; |
111 | 114 |
112 private: | 115 private: |
113 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); | 116 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
114 | 117 |
115 // Writes application stability metrics (as part of the profile log). | 118 // Writes application stability metrics (as part of the profile log). |
116 // NOTE: Has the side-effect of clearing those counts. | 119 // NOTE: Has the side-effect of clearing those counts. |
117 void WriteStabilityElement( | 120 void WriteStabilityElement( |
118 const std::vector<webkit::WebPluginInfo>& plugin_list, | 121 const std::vector<webkit::WebPluginInfo>& plugin_list, |
119 PrefService* pref); | 122 PrefService* pref); |
120 | 123 |
(...skipping 27 matching lines...) Expand all Loading... |
148 | 151 |
149 // Writes metrics for the profile identified by key. This writes all | 152 // Writes metrics for the profile identified by key. This writes all |
150 // key/value pairs in profile_metrics. | 153 // key/value pairs in profile_metrics. |
151 void WriteProfileMetrics(const std::string& key, | 154 void WriteProfileMetrics(const std::string& key, |
152 const base::DictionaryValue& profile_metrics); | 155 const base::DictionaryValue& profile_metrics); |
153 | 156 |
154 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 157 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
155 }; | 158 }; |
156 | 159 |
157 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 160 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |