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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 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 #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 41
41 namespace policy { 42 namespace policy {
42 43
43 // Collects and summarizes the status of an enterprised-managed ChromeOS device. 44 // Collects and summarizes the status of an enterprised-managed ChromeOS device.
44 class DeviceStatusCollector : public CloudPolicyClient::StatusProvider, 45 class DeviceStatusCollector : public CloudPolicyClient::StatusProvider,
45 public content::NotificationObserver { 46 public content::NotificationObserver {
46 public: 47 public:
47 // 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
48 // way to mock geolocation exists. 49 // way to mock geolocation exists.
49 typedef void(*LocationUpdateRequester)( 50 typedef void(*LocationUpdateRequester)(
50 const content::GeolocationUpdateCallback& callback); 51 const content::GeolocationUpdateCallback& callback);
51 52
52 DeviceStatusCollector(PrefService* local_state, 53 DeviceStatusCollector(PrefService* local_state,
53 chromeos::system::StatisticsProvider* provider, 54 chromeos::system::StatisticsProvider* provider,
54 LocationUpdateRequester location_update_requester); 55 LocationUpdateRequester location_update_requester);
55 virtual ~DeviceStatusCollector(); 56 virtual ~DeviceStatusCollector();
56 57
57 void GetStatus(enterprise_management::DeviceStatusReportRequest* request); 58 void GetStatus(enterprise_management::DeviceStatusReportRequest* request);
58 59
59 // CloudPolicyClient::StatusProvider: 60 // CloudPolicyClient::StatusProvider:
60 virtual bool GetDeviceStatus( 61 virtual bool GetDeviceStatus(
61 enterprise_management::DeviceStatusReportRequest* status) OVERRIDE; 62 enterprise_management::DeviceStatusReportRequest* status) OVERRIDE;
62 virtual bool GetSessionStatus( 63 virtual bool GetSessionStatus(
63 enterprise_management::SessionStatusReportRequest* status) OVERRIDE; 64 enterprise_management::SessionStatusReportRequest* status) OVERRIDE;
64 virtual void OnSubmittedSuccessfully() OVERRIDE; 65 virtual void OnSubmittedSuccessfully() OVERRIDE;
65 66
66 static void RegisterPrefs(PrefService* local_state); 67 static void RegisterPrefs(PrefServiceSimple* local_state);
67 68
68 // 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.
69 static const unsigned int kIdlePollIntervalSeconds = 30; 70 static const unsigned int kIdlePollIntervalSeconds = 30;
70 71
71 protected: 72 protected:
72 // 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.
73 virtual void CheckIdleState(); 74 virtual void CheckIdleState();
74 75
75 // Used instead of base::Time::Now(), to make testing possible. 76 // Used instead of base::Time::Now(), to make testing possible.
76 virtual base::Time GetCurrentTime(); 77 virtual base::Time GetCurrentTime();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 bool report_activity_times_; 174 bool report_activity_times_;
174 bool report_boot_mode_; 175 bool report_boot_mode_;
175 bool report_location_; 176 bool report_location_;
176 177
177 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); 178 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector);
178 }; 179 };
179 180
180 } // namespace policy 181 } // namespace policy
181 182
182 #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