| 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_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 typedef base::Callback<void( | 52 typedef base::Callback<void( |
| 53 const content::GeolocationProvider::LocationUpdateCallback& callback)> | 53 const content::GeolocationProvider::LocationUpdateCallback& callback)> |
| 54 LocationUpdateRequester; | 54 LocationUpdateRequester; |
| 55 | 55 |
| 56 DeviceStatusCollector( | 56 DeviceStatusCollector( |
| 57 PrefService* local_state, | 57 PrefService* local_state, |
| 58 chromeos::system::StatisticsProvider* provider, | 58 chromeos::system::StatisticsProvider* provider, |
| 59 LocationUpdateRequester* location_update_requester); | 59 LocationUpdateRequester* location_update_requester); |
| 60 virtual ~DeviceStatusCollector(); | 60 virtual ~DeviceStatusCollector(); |
| 61 | 61 |
| 62 void GetStatus(enterprise_management::DeviceStatusReportRequest* request); | |
| 63 | |
| 64 // CloudPolicyClient::StatusProvider: | 62 // CloudPolicyClient::StatusProvider: |
| 65 virtual bool GetDeviceStatus( | 63 virtual bool GetDeviceStatus( |
| 66 enterprise_management::DeviceStatusReportRequest* status) override; | 64 enterprise_management::DeviceStatusReportRequest* status) override; |
| 67 virtual bool GetSessionStatus( | 65 virtual bool GetSessionStatus( |
| 68 enterprise_management::SessionStatusReportRequest* status) override; | 66 enterprise_management::SessionStatusReportRequest* status) override; |
| 69 virtual void OnSubmittedSuccessfully() override; | 67 virtual void OnSubmittedSuccessfully() override; |
| 70 | 68 |
| 71 static void RegisterPrefs(PrefRegistrySimple* registry); | 69 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 72 | 70 |
| 73 // How often, in seconds, to poll to see if the user is idle. | 71 // How often, in seconds, to poll to see if the user is idle. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void GetVersionInfo( | 114 void GetVersionInfo( |
| 117 enterprise_management::DeviceStatusReportRequest* request); | 115 enterprise_management::DeviceStatusReportRequest* request); |
| 118 void GetBootMode( | 116 void GetBootMode( |
| 119 enterprise_management::DeviceStatusReportRequest* request); | 117 enterprise_management::DeviceStatusReportRequest* request); |
| 120 void GetLocation( | 118 void GetLocation( |
| 121 enterprise_management::DeviceStatusReportRequest* request); | 119 enterprise_management::DeviceStatusReportRequest* request); |
| 122 void GetNetworkInterfaces( | 120 void GetNetworkInterfaces( |
| 123 enterprise_management::DeviceStatusReportRequest* request); | 121 enterprise_management::DeviceStatusReportRequest* request); |
| 124 void GetUsers( | 122 void GetUsers( |
| 125 enterprise_management::DeviceStatusReportRequest* request); | 123 enterprise_management::DeviceStatusReportRequest* request); |
| 124 void GetHardwareStatus( |
| 125 enterprise_management::DeviceStatusReportRequest* request); |
| 126 | 126 |
| 127 // Update the cached values of the reporting settings. | 127 // Update the cached values of the reporting settings. |
| 128 void UpdateReportingSettings(); | 128 void UpdateReportingSettings(); |
| 129 | 129 |
| 130 void ScheduleGeolocationUpdateRequest(); | 130 void ScheduleGeolocationUpdateRequest(); |
| 131 | 131 |
| 132 // content::GeolocationUpdateCallback implementation. | 132 // content::GeolocationUpdateCallback implementation. |
| 133 void ReceiveGeolocationUpdate(const content::Geoposition&); | 133 void ReceiveGeolocationUpdate(const content::Geoposition&); |
| 134 | 134 |
| 135 // How often to poll to see if the user is idle. | 135 // How often to poll to see if the user is idle. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 scoped_ptr<content::GeolocationProvider::Subscription> | 172 scoped_ptr<content::GeolocationProvider::Subscription> |
| 173 geolocation_subscription_; | 173 geolocation_subscription_; |
| 174 | 174 |
| 175 // Cached values of the reporting settings from the device policy. | 175 // Cached values of the reporting settings from the device policy. |
| 176 bool report_version_info_; | 176 bool report_version_info_; |
| 177 bool report_activity_times_; | 177 bool report_activity_times_; |
| 178 bool report_boot_mode_; | 178 bool report_boot_mode_; |
| 179 bool report_location_; | 179 bool report_location_; |
| 180 bool report_network_interfaces_; | 180 bool report_network_interfaces_; |
| 181 bool report_users_; | 181 bool report_users_; |
| 182 bool report_hardware_status_; |
| 182 | 183 |
| 183 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 184 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 184 version_info_subscription_; | 185 version_info_subscription_; |
| 185 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 186 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 186 activity_times_subscription_; | 187 activity_times_subscription_; |
| 187 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 188 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 188 boot_mode_subscription_; | 189 boot_mode_subscription_; |
| 189 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 190 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 190 location_subscription_; | 191 location_subscription_; |
| 191 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 192 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 192 network_interfaces_subscription_; | 193 network_interfaces_subscription_; |
| 193 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 194 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 194 users_subscription_; | 195 users_subscription_; |
| 196 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 197 hardware_status_subscription_; |
| 195 | 198 |
| 196 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; | 199 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; |
| 197 | 200 |
| 198 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 201 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
| 199 }; | 202 }; |
| 200 | 203 |
| 201 } // namespace policy | 204 } // namespace policy |
| 202 | 205 |
| 203 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 206 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| OLD | NEW |