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

Side by Side Diff: chrome/browser/chromeos/policy/remote_commands/affiliated_remote_commands_invalidator.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/chromeos/policy/remote_commands/affiliated_remote_comma nds_invalidator.h"
6
7 #include "chrome/browser/policy/cloud/remote_commands_invalidator_impl.h"
8
9 namespace policy {
10
11 AffiliatedRemoteCommandsInvalidator::AffiliatedRemoteCommandsInvalidator(
12 CloudPolicyCore* core,
13 AffiliatedInvalidationServiceProvider* invalidation_service_provider)
14 : core_(core),
15 invalidation_service_provider_(invalidation_service_provider) {
16 invalidation_service_provider_->RegisterConsumer(this);
17 }
18
19 AffiliatedRemoteCommandsInvalidator::~AffiliatedRemoteCommandsInvalidator() {
20 invalidation_service_provider_->UnregisterConsumer(this);
21 }
22
23 void AffiliatedRemoteCommandsInvalidator::OnInvalidationServiceSet(
24 invalidation::InvalidationService* invalidation_service) {
25 // Destroy this invalidator if it exists.
26 if (invalidator_) {
27 invalidator_->Shutdown();
28 invalidator_.reset();
29 }
30 // Create a new one if required.
31 if (invalidation_service) {
32 invalidator_.reset(new RemoteCommandsInvalidatorImpl(core_));
33 invalidator_->Initialize(invalidation_service);
34 }
35 }
36
37 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698