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

Unified Diff: chrome/browser/policy/cloud/remote_commands_invalidator_impl.h

Issue 1094493003: Initial RemoteCommandsInvalidator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: fixes addressing #7 and #8 Created 5 years, 7 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/policy/cloud/remote_commands_invalidator_impl.h
diff --git a/chrome/browser/policy/cloud/remote_commands_invalidator_impl.h b/chrome/browser/policy/cloud/remote_commands_invalidator_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..aca0aef1e7f31202e075e5b485b89e7be4010234
--- /dev/null
+++ b/chrome/browser/policy/cloud/remote_commands_invalidator_impl.h
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_POLICY_CLOUD_REMOTE_COMMANDS_INVALIDATOR_IMPL_H_
+#define CHROME_BROWSER_POLICY_CLOUD_REMOTE_COMMANDS_INVALIDATOR_IMPL_H_
+
+#include "base/macros.h"
+#include "chrome/browser/policy/cloud/remote_commands_invalidator.h"
+#include "components/policy/core/common/cloud/cloud_policy_core.h"
+#include "components/policy/core/common/cloud/cloud_policy_store.h"
+
+namespace policy {
+
+// Implementation of invalidator for remote commands services. This class
+// listens to events from CloudPolicyCore and CloudPolicyStore and builds
+// with RemoteCommandsInvalidator to complete the tasks.
+class RemoteCommandsInvalidatorImpl : public RemoteCommandsInvalidator,
+ public CloudPolicyCore::Observer,
+ public CloudPolicyStore::Observer {
+ public:
+ explicit RemoteCommandsInvalidatorImpl(CloudPolicyCore* core);
+
+ // RemoteCommandsInvalidator:
+ void OnInitialize() override;
+ void OnShutdown() override;
+ void OnStart() override;
+ void OnStop() override;
+ void DoRemoteCommandsFetch() override;
+
+ // CloudPolicyCore::Observer:
+ void OnCoreConnected(CloudPolicyCore* core) override;
+ void OnRefreshSchedulerStarted(CloudPolicyCore* core) override;
+ void OnCoreDisconnecting(CloudPolicyCore* core) override;
+ void OnRemoteCommandsServiceStarted(CloudPolicyCore* core) override;
+
+ // CloudPolicyStore::Observer:
+ void OnStoreLoaded(CloudPolicyStore* store) override;
+ void OnStoreError(CloudPolicyStore* store) override;
+
+ private:
+ CloudPolicyCore* const core_;
+
+ DISALLOW_COPY_AND_ASSIGN(RemoteCommandsInvalidatorImpl);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_CLOUD_REMOTE_COMMANDS_INVALIDATOR_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698