| 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 #ifndef CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_STATISTICS_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_STATISTICS_COLLECTOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/cancelable_callback.h" | 9 #include "base/cancelable_callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "components/policy/core/common/policy_details.h" | 12 #include "components/policy/core/common/policy_details.h" |
| 13 #include "components/policy/core/common/schema.h" | 13 #include "components/policy/core/common/schema.h" |
| 14 #include "components/policy/policy_export.h" |
| 14 | 15 |
| 15 class PrefService; | 16 class PrefService; |
| 16 class PrefRegistrySimple; | 17 class PrefRegistrySimple; |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class TaskRunner; | 20 class TaskRunner; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace policy { | 23 namespace policy { |
| 23 | 24 |
| 24 class PolicyService; | 25 class PolicyService; |
| 25 | 26 |
| 26 // Manages regular updates of policy usage UMA histograms. | 27 // Manages regular updates of policy usage UMA histograms. |
| 27 class PolicyStatisticsCollector { | 28 class POLICY_EXPORT PolicyStatisticsCollector { |
| 28 public: | 29 public: |
| 29 // Policy usage statistics update rate, in milliseconds. | 30 // Policy usage statistics update rate, in milliseconds. |
| 30 static const int kStatisticsUpdateRate; | 31 static const int kStatisticsUpdateRate; |
| 31 | 32 |
| 32 // Neither |policy_service| nor |prefs| can be NULL and must stay valid | 33 // Neither |policy_service| nor |prefs| can be NULL and must stay valid |
| 33 // throughout the lifetime of PolicyStatisticsCollector. | 34 // throughout the lifetime of PolicyStatisticsCollector. |
| 34 PolicyStatisticsCollector(const GetChromePolicyDetailsCallback& get_details, | 35 PolicyStatisticsCollector(const GetChromePolicyDetailsCallback& get_details, |
| 35 const Schema& chrome_schema, | 36 const Schema& chrome_schema, |
| 36 PolicyService* policy_service, | 37 PolicyService* policy_service, |
| 37 PrefService* prefs, | 38 PrefService* prefs, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 58 | 59 |
| 59 base::CancelableClosure update_callback_; | 60 base::CancelableClosure update_callback_; |
| 60 | 61 |
| 61 const scoped_refptr<base::TaskRunner> task_runner_; | 62 const scoped_refptr<base::TaskRunner> task_runner_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(PolicyStatisticsCollector); | 64 DISALLOW_COPY_AND_ASSIGN(PolicyStatisticsCollector); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace policy | 67 } // namespace policy |
| 67 | 68 |
| 68 #endif // CHROME_BROWSER_POLICY_POLICY_STATISTICS_COLLECTOR_H_ | 69 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_STATISTICS_COLLECTOR_H_ |
| OLD | NEW |