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

Side by Side Diff: chrome/browser/policy/cloud/remote_commands_invalidator_impl.cc

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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/policy/cloud/remote_commands_invalidator_impl.h"
6
7 #include "base/logging.h"
8 #include "components/policy/core/common/remote_commands/remote_commands_service. h"
9
10 namespace policy {
11
12 RemoteCommandsInvalidatorImpl::RemoteCommandsInvalidatorImpl(
13 CloudPolicyCore* core)
14 : core_(core) {
15 DCHECK(core_);
16 }
17
18 void RemoteCommandsInvalidatorImpl::OnInitialize() {
19 core_->AddObserver(this);
20 if (core_->remote_commands_service())
21 OnRemoteCommandsServiceStarted(core_);
22 }
23
24 void RemoteCommandsInvalidatorImpl::OnShutdown() {
25 core_->RemoveObserver(this);
26 }
27
28 void RemoteCommandsInvalidatorImpl::OnStart() {
29 core_->store()->AddObserver(this);
30 OnStoreLoaded(core_->store());
31 }
32
33 void RemoteCommandsInvalidatorImpl::OnStop() {
34 core_->store()->RemoveObserver(this);
35 }
36
37 void RemoteCommandsInvalidatorImpl::DoRemoteCommandsFetch() {
38 DCHECK(core_->remote_commands_service());
39 core_->remote_commands_service()->FetchRemoteCommands();
40 }
41
42 void RemoteCommandsInvalidatorImpl::OnCoreConnected(CloudPolicyCore* core) {
43 }
44
45 void RemoteCommandsInvalidatorImpl::OnRefreshSchedulerStarted(
46 CloudPolicyCore* core) {
47 }
48
49 void RemoteCommandsInvalidatorImpl::OnCoreDisconnecting(CloudPolicyCore* core) {
50 Stop();
51 }
52
53 void RemoteCommandsInvalidatorImpl::OnRemoteCommandsServiceStarted(
54 CloudPolicyCore* core) {
55 Start();
56 }
57
58 void RemoteCommandsInvalidatorImpl::OnStoreLoaded(CloudPolicyStore* core) {
59 ReloadPolicyData(core_->store()->policy());
60 }
61
62 void RemoteCommandsInvalidatorImpl::OnStoreError(CloudPolicyStore* core) {
63 }
64
65 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698