| 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 | |
| 89 // At startup, prefs needs to be called with a list of all the pref names and | 85 // At startup, prefs needs to be called with a list of all the pref names and |
| 90 // types we'll be using. | 86 // types we'll be using. |
| 91 static void RegisterPrefs(PrefService* local_state); | 87 static void RegisterPrefs(PrefService* local_state); |
| 92 | 88 |
| 93 // Set up notifications which indicate that a user is performing work. This is | 89 // Set up notifications which indicate that a user is performing work. This is |
| 94 // useful to allow some features to sleep, until the machine becomes active, | 90 // useful to allow some features to sleep, until the machine becomes active, |
| 95 // such as precluding UMA uploads unless there was recent activity. | 91 // such as precluding UMA uploads unless there was recent activity. |
| 96 static void SetUpNotifications(NotificationRegistrar* registrar, | 92 static void SetUpNotifications(NotificationRegistrar* registrar, |
| 97 NotificationObserver* observer); | 93 NotificationObserver* observer); |
| 98 | 94 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); | 415 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); |
| 420 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); | 416 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); |
| 421 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); | 417 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); |
| 422 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); | 418 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); |
| 423 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); | 419 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); |
| 424 | 420 |
| 425 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 421 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
| 426 }; | 422 }; |
| 427 | 423 |
| 428 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 424 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |