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

Unified Diff: components/policy/core/common/cloud/cloud_policy_core.cc

Issue 879233003: Initial RemoteCommandService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remote-commands
Patch Set: rebase, fixes addressing #31 Created 5 years, 9 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: components/policy/core/common/cloud/cloud_policy_core.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_core.cc b/components/policy/core/common/cloud/cloud_policy_core.cc
index dd9f46eb30158c901649bfd15db83b41352e2d54..f1f5fca52b309b57b8a822745aa9116433baa6af 100644
--- a/components/policy/core/common/cloud/cloud_policy_core.cc
+++ b/components/policy/core/common/cloud/cloud_policy_core.cc
@@ -6,11 +6,14 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/logging.h"
#include "base/prefs/pref_service.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
#include "components/policy/core/common/cloud/cloud_policy_service.h"
#include "components/policy/core/common/cloud/cloud_policy_store.h"
+#include "components/policy/core/common/remote_commands/remote_commands_factory.h"
+#include "components/policy/core/common/remote_commands/remote_commands_service.h"
namespace policy {
@@ -46,6 +49,18 @@ void CloudPolicyCore::Disconnect() {
client_.reset();
}
+void CloudPolicyCore::StartRemoteCommandsService(
+ scoped_ptr<RemoteCommandsFactory> factory) {
+ DCHECK(client_);
+ DCHECK(factory);
+
+ remote_commands_service_.reset(
+ new RemoteCommandsService(factory.Pass(), client_.get()));
+
+ // Do an initial remote commands fetch immediately.
+ remote_commands_service_->FetchRemoteCommands();
+}
+
void CloudPolicyCore::RefreshSoon() {
if (refresh_scheduler_)
refresh_scheduler_->RefreshSoon();

Powered by Google App Engine
This is Rietveld 408576698