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 #include "chrome/browser/policy/policy_statistics_collector.h" | 5 #include "chrome/browser/policy/policy_statistics_collector.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/prefs/pref_registry_simple.h" | 13 #include "base/prefs/pref_registry_simple.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
| 16 #include "chrome/browser/policy/policy_namespace.h" |
16 #include "chrome/browser/policy/policy_service.h" | 17 #include "chrome/browser/policy/policy_service.h" |
17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
18 #include "policy/policy_constants.h" | 19 #include "policy/policy_constants.h" |
19 | 20 |
20 namespace policy { | 21 namespace policy { |
21 | 22 |
22 const int PolicyStatisticsCollector::kStatisticsUpdateRate = | 23 const int PolicyStatisticsCollector::kStatisticsUpdateRate = |
23 24 * 60 * 60 * 1000; // 24 hours. | 24 24 * 60 * 60 * 1000; // 24 hours. |
24 | 25 |
25 PolicyStatisticsCollector::PolicyStatisticsCollector( | 26 PolicyStatisticsCollector::PolicyStatisticsCollector( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 93 } |
93 | 94 |
94 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { | 95 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { |
95 update_callback_.Reset(base::Bind( | 96 update_callback_.Reset(base::Bind( |
96 &PolicyStatisticsCollector::CollectStatistics, | 97 &PolicyStatisticsCollector::CollectStatistics, |
97 base::Unretained(this))); | 98 base::Unretained(this))); |
98 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); | 99 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); |
99 } | 100 } |
100 | 101 |
101 } // namespace policy | 102 } // namespace policy |
OLD | NEW |