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

Unified Diff: chrome/browser/chromeos/policy/device_status_collector.h

Issue 845313008: Refactored device status uploading out of policy fetch infrastructure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/device_status_collector.h
diff --git a/chrome/browser/chromeos/policy/device_status_collector.h b/chrome/browser/chromeos/policy/device_status_collector.h
index 0780cff0cc9e6dfa7deae361aceaf7c8ac4b56ff..d9402b7d7e4876013f83dc4c3eb99cb6b9889e67 100644
--- a/chrome/browser/chromeos/policy/device_status_collector.h
+++ b/chrome/browser/chromeos/policy/device_status_collector.h
@@ -21,7 +21,6 @@
#include "base/timer/timer.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chromeos/system/version_loader.h"
-#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "content/public/browser/geolocation_provider.h"
#include "content/public/common/geoposition.h"
#include "policy/proto/device_management_backend.pb.h"
@@ -45,7 +44,7 @@ class PrefService;
namespace policy {
// Collects and summarizes the status of an enterprised-managed ChromeOS device.
-class DeviceStatusCollector : public CloudPolicyClient::StatusProvider {
+class DeviceStatusCollector {
public:
// TODO(bartfab): Remove this once crbug.com/125931 is addressed and a proper
// way to mock geolocation exists.
@@ -64,14 +63,23 @@ class DeviceStatusCollector : public CloudPolicyClient::StatusProvider {
chromeos::system::StatisticsProvider* provider,
const LocationUpdateRequester& location_update_requester,
const VolumeInfoFetcher& volume_info_fetcher);
- ~DeviceStatusCollector() override;
-
- // CloudPolicyClient::StatusProvider:
- bool GetDeviceStatus(
- enterprise_management::DeviceStatusReportRequest* status) override;
- bool GetSessionStatus(
- enterprise_management::SessionStatusReportRequest* status) override;
- void OnSubmittedSuccessfully() override;
+ virtual ~DeviceStatusCollector();
+
+ // Fills in the passed proto with device status information. Will return
+ // false if no status information is filled in (because status reporting
+ // is disabled).
+ virtual bool GetDeviceStatus(
+ enterprise_management::DeviceStatusReportRequest* status);
+
+ // Fills in the passed proto with session status information. Will return
+ // false if no status information is filled in (because status reporting
+ // is disabled, or because the active session is not a kiosk session).
+ virtual bool GetDeviceSessionStatus(
+ enterprise_management::SessionStatusReportRequest* status);
+
+ // Called after the status information has successfully been submitted to
+ // the server.
+ void OnSubmittedSuccessfully();
static void RegisterPrefs(PrefRegistrySimple* registry);

Powered by Google App Engine
This is Rietveld 408576698