Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/policy/policy_statistics_collector.h

Issue 10916235: Record policy usage statistics every 24 hours. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments, moved PolicyStatisticsCollector to BrowserPolicyConnector, fixed policy sorting Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/basictypes.h"
9 #include "base/cancelable_callback.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/time.h"
12
13 class PrefService;
14
15 namespace base {
16 class TaskRunner;
17 }
18
19 namespace policy {
20
21 class PolicyService;
22
23 // Manages regular updates of policy usage UMA histograms.
24 class PolicyStatisticsCollector {
25 public:
26 // Neither |policy_service| nor |prefs| can be NULL and must stay valid
27 // throughout the lifetime of PolicyStatisticsCollector.
28 PolicyStatisticsCollector(PolicyService* policy_service,
29 PrefService* prefs,
30 const scoped_refptr<base::TaskRunner>& task_runner);
31 ~PolicyStatisticsCollector();
32
33 static void RegisterPrefs(PrefService* prefs);
34
35 private:
36 void CollectStatistics();
37 void ScheduleUpdate(base::TimeDelta delay);
38
39 PolicyService* policy_service_;
40 PrefService* prefs_;
41
42 base::CancelableClosure update_callback_;
43
44 const scoped_refptr<base::TaskRunner> task_runner_;
45
46 DISALLOW_COPY_AND_ASSIGN(PolicyStatisticsCollector);
47 };
48
49 } // namespace policy
50
51 #endif // CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698