Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_ | |
| 6 #define CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_ | |
| 7 | |
| 8 #include "base/cancelable_callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/time.h" | |
| 11 | |
| 12 class PrefService; | |
| 13 | |
| 14 namespace base { | |
| 15 class TaskRunner; | |
| 16 } | |
| 17 | |
| 18 namespace policy { | |
| 19 | |
| 20 class PolicyService; | |
| 21 | |
| 22 // Manages regular updates of policy usage statistics. | |
|
Mattias Nissler (ping if slow)
2012/09/12 13:06:27
You should mention UMA somewhere, since this is th
qfel
2012/09/18 11:30:56
Done.
| |
| 23 class PolicyStatisticsCollector { | |
| 24 public: | |
| 25 // Neither |policy_service| nor |prefs| can be NULL and must stay valid | |
| 26 // throughout the lifetime of PolicyStatisticsCollector. | |
| 27 PolicyStatisticsCollector(PolicyService* policy_service, | |
| 28 PrefService* prefs, | |
| 29 const scoped_refptr<base::TaskRunner>& task_runner); | |
| 30 ~PolicyStatisticsCollector(); | |
| 31 | |
| 32 static void RegisterPrefs(PrefService* prefs); | |
| 33 | |
| 34 private: | |
| 35 void CollectStatistics(); | |
| 36 void ScheduleUpdate(base::TimeDelta delay); | |
| 37 | |
| 38 PolicyService* policy_service_; | |
| 39 PrefService* prefs_; | |
| 40 | |
| 41 base::CancelableClosure update_callback_; | |
| 42 | |
| 43 const scoped_refptr<base::TaskRunner> task_runner_; | |
|
Mattias Nissler (ping if slow)
2012/09/12 13:06:27
DISALLOW_COPY_AND_ASSIGN
qfel
2012/09/18 11:30:56
Done.
| |
| 44 }; | |
| 45 | |
| 46 } // namespace policy | |
| 47 | |
| 48 #endif // CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_ | |
| OLD | NEW |