OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 service that collects information about the user | 5 // This file defines a service that collects information about the user |
6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
7 | 7 |
8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 virtual ~MetricsService(); | 75 virtual ~MetricsService(); |
76 | 76 |
77 // Start/stop the metrics recording and uploading machine. These should be | 77 // Start/stop the metrics recording and uploading machine. These should be |
78 // used on startup and when the user clicks the checkbox in the prefs. | 78 // used on startup and when the user clicks the checkbox in the prefs. |
79 // StartRecordingOnly starts the metrics recording but not reporting, for use | 79 // StartRecordingOnly starts the metrics recording but not reporting, for use |
80 // in tests only. | 80 // in tests only. |
81 void Start(); | 81 void Start(); |
82 void StartRecordingOnly(); | 82 void StartRecordingOnly(); |
83 void Stop(); | 83 void Stop(); |
84 | 84 |
| 85 // Returns the client ID for this client, or the empty string if metrics |
| 86 // recording is not currently running. |
| 87 std::string GetClientId(); |
| 88 |
85 // At startup, prefs needs to be called with a list of all the pref names and | 89 // At startup, prefs needs to be called with a list of all the pref names and |
86 // types we'll be using. | 90 // types we'll be using. |
87 static void RegisterPrefs(PrefService* local_state); | 91 static void RegisterPrefs(PrefService* local_state); |
88 | 92 |
89 // Set up notifications which indicate that a user is performing work. This is | 93 // Set up notifications which indicate that a user is performing work. This is |
90 // useful to allow some features to sleep, until the machine becomes active, | 94 // useful to allow some features to sleep, until the machine becomes active, |
91 // such as precluding UMA uploads unless there was recent activity. | 95 // such as precluding UMA uploads unless there was recent activity. |
92 static void SetUpNotifications(NotificationRegistrar* registrar, | 96 static void SetUpNotifications(NotificationRegistrar* registrar, |
93 NotificationObserver* observer); | 97 NotificationObserver* observer); |
94 | 98 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); | 419 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); |
416 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); | 420 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); |
417 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); | 421 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); |
418 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); | 422 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); |
419 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); | 423 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); |
420 | 424 |
421 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 425 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
422 }; | 426 }; |
423 | 427 |
424 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 428 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |