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

Side by Side Diff: components/policy/core/common/policy_statistics_collector.cc

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 "components/policy/core/common/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/callback.h" 11 #include "base/callback.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/metrics/sparse_histogram.h" 14 #include "base/metrics/sparse_histogram.h"
15 #include "base/prefs/pref_registry_simple.h" 15 #include "base/prefs/pref_registry_simple.h"
16 #include "base/prefs/pref_service.h" 16 #include "base/prefs/pref_service.h"
17 #include "base/task_runner.h" 17 #include "base/task_runner.h"
18 #include "chrome/browser/policy/policy_service.h"
19 #include "components/policy/core/common/policy_pref_names.h" 18 #include "components/policy/core/common/policy_pref_names.h"
19 #include "components/policy/core/common/policy_service.h"
20 20
21 namespace policy { 21 namespace policy {
22 22
23 const int PolicyStatisticsCollector::kStatisticsUpdateRate = 23 const int PolicyStatisticsCollector::kStatisticsUpdateRate =
24 24 * 60 * 60 * 1000; // 24 hours. 24 24 * 60 * 60 * 1000; // 24 hours.
25 25
26 PolicyStatisticsCollector::PolicyStatisticsCollector( 26 PolicyStatisticsCollector::PolicyStatisticsCollector(
27 const GetChromePolicyDetailsCallback& get_details, 27 const GetChromePolicyDetailsCallback& get_details,
28 const Schema& chrome_schema, 28 const Schema& chrome_schema,
29 PolicyService* policy_service, 29 PolicyService* policy_service,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { 87 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) {
88 update_callback_.Reset(base::Bind( 88 update_callback_.Reset(base::Bind(
89 &PolicyStatisticsCollector::CollectStatistics, 89 &PolicyStatisticsCollector::CollectStatistics,
90 base::Unretained(this))); 90 base::Unretained(this)));
91 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); 91 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay);
92 } 92 }
93 93
94 } // namespace policy 94 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698