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

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

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. Created 7 years, 10 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 | 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 #ifndef CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_
6 #define CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ 6 #define CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 19 matching lines...) Expand all
30 namespace content { 30 namespace content {
31 class NotificationDetails; 31 class NotificationDetails;
32 class NotificationSource; 32 class NotificationSource;
33 } 33 }
34 34
35 namespace enterprise_management { 35 namespace enterprise_management {
36 class DeviceStatusReportRequest; 36 class DeviceStatusReportRequest;
37 } 37 }
38 38
39 class PrefService; 39 class PrefService;
40 class PrefServiceSimple; 40 class PrefRegistrySimple;
41 41
42 namespace policy { 42 namespace policy {
43 43
44 // Collects and summarizes the status of an enterprised-managed ChromeOS device. 44 // Collects and summarizes the status of an enterprised-managed ChromeOS device.
45 class DeviceStatusCollector : public CloudPolicyClient::StatusProvider, 45 class DeviceStatusCollector : public CloudPolicyClient::StatusProvider,
46 public content::NotificationObserver { 46 public content::NotificationObserver {
47 public: 47 public:
48 // TODO(bartfab): Remove this once crbug.com/125931 is addressed and a proper 48 // TODO(bartfab): Remove this once crbug.com/125931 is addressed and a proper
49 // way to mock geolocation exists. 49 // way to mock geolocation exists.
50 typedef void(*LocationUpdateRequester)( 50 typedef void(*LocationUpdateRequester)(
51 const content::GeolocationUpdateCallback& callback); 51 const content::GeolocationUpdateCallback& callback);
52 52
53 DeviceStatusCollector(PrefService* local_state, 53 DeviceStatusCollector(PrefService* local_state,
54 chromeos::system::StatisticsProvider* provider, 54 chromeos::system::StatisticsProvider* provider,
55 LocationUpdateRequester location_update_requester); 55 LocationUpdateRequester location_update_requester);
56 virtual ~DeviceStatusCollector(); 56 virtual ~DeviceStatusCollector();
57 57
58 void GetStatus(enterprise_management::DeviceStatusReportRequest* request); 58 void GetStatus(enterprise_management::DeviceStatusReportRequest* request);
59 59
60 // CloudPolicyClient::StatusProvider: 60 // CloudPolicyClient::StatusProvider:
61 virtual bool GetDeviceStatus( 61 virtual bool GetDeviceStatus(
62 enterprise_management::DeviceStatusReportRequest* status) OVERRIDE; 62 enterprise_management::DeviceStatusReportRequest* status) OVERRIDE;
63 virtual bool GetSessionStatus( 63 virtual bool GetSessionStatus(
64 enterprise_management::SessionStatusReportRequest* status) OVERRIDE; 64 enterprise_management::SessionStatusReportRequest* status) OVERRIDE;
65 virtual void OnSubmittedSuccessfully() OVERRIDE; 65 virtual void OnSubmittedSuccessfully() OVERRIDE;
66 66
67 static void RegisterPrefs(PrefServiceSimple* local_state); 67 static void RegisterPrefs(PrefRegistrySimple* registry);
68 68
69 // How often, in seconds, to poll to see if the user is idle. 69 // How often, in seconds, to poll to see if the user is idle.
70 static const unsigned int kIdlePollIntervalSeconds = 30; 70 static const unsigned int kIdlePollIntervalSeconds = 30;
71 71
72 protected: 72 protected:
73 // Check whether the user has been idle for a certain period of time. 73 // Check whether the user has been idle for a certain period of time.
74 virtual void CheckIdleState(); 74 virtual void CheckIdleState();
75 75
76 // Used instead of base::Time::Now(), to make testing possible. 76 // Used instead of base::Time::Now(), to make testing possible.
77 virtual base::Time GetCurrentTime(); 77 virtual base::Time GetCurrentTime();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 bool report_activity_times_; 174 bool report_activity_times_;
175 bool report_boot_mode_; 175 bool report_boot_mode_;
176 bool report_location_; 176 bool report_location_;
177 177
178 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); 178 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector);
179 }; 179 };
180 180
181 } // namespace policy 181 } // namespace policy
182 182
183 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ 183 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698