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_service.h" | 16 #include "chrome/browser/policy/policy_service.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "components/policy/core/common/policy_pref_names.h" |
18 #include "policy/policy_constants.h" | 18 #include "policy/policy_constants.h" |
19 | 19 |
20 namespace policy { | 20 namespace policy { |
21 | 21 |
22 const int PolicyStatisticsCollector::kStatisticsUpdateRate = | 22 const int PolicyStatisticsCollector::kStatisticsUpdateRate = |
23 24 * 60 * 60 * 1000; // 24 hours. | 23 24 * 60 * 60 * 1000; // 24 hours. |
24 | 24 |
25 PolicyStatisticsCollector::PolicyStatisticsCollector( | 25 PolicyStatisticsCollector::PolicyStatisticsCollector( |
26 PolicyService* policy_service, | 26 PolicyService* policy_service, |
27 PrefService* prefs, | 27 PrefService* prefs, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { | 94 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { |
95 update_callback_.Reset(base::Bind( | 95 update_callback_.Reset(base::Bind( |
96 &PolicyStatisticsCollector::CollectStatistics, | 96 &PolicyStatisticsCollector::CollectStatistics, |
97 base::Unretained(this))); | 97 base::Unretained(this))); |
98 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); | 98 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); |
99 } | 99 } |
100 | 100 |
101 } // namespace policy | 101 } // namespace policy |
OLD | NEW |