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

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

Issue 822523003: Implement device-local account policy pushing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_442800_switch_device_cloud_policy_invalidator
Patch Set: Rebased. Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_invalidator.h b/chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h
similarity index 51%
rename from chrome/browser/chromeos/policy/device_cloud_policy_invalidator.h
rename to chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h
index e767514bc37104d54b6e8ccd6dcdd8155c3e41ff..162f39b14e6d55a78efbe4fe0a1b5b15bd221139 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_invalidator.h
+++ b/chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h
@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INVALIDATOR_H_
-#define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INVALIDATOR_H_
+#ifndef CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATED_CLOUD_POLICY_INVALIDATOR_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATED_CLOUD_POLICY_INVALIDATOR_H_
#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provider.h"
+#include "policy/proto/device_management_backend.pb.h"
namespace invalidation {
class InvalidationService;
@@ -16,20 +17,25 @@ class InvalidationService;
namespace policy {
+class CloudPolicyCore;
class CloudPolicyInvalidator;
-// This class manages the lifetime of a device-global |CloudPolicyInvalidator|
-// that handles device policy invalidations. It relies on an
-// |AffiliatedInvalidationServiceProvider| to provide it with access to a shared
-// |InvalidationService| to back the |CloudPolicyInvalidator|. Whenever the
-// shared |InvalidationService| changes, the |CloudPolicyInvalidator| destroyed
-// and re-created.
-class DeviceCloudPolicyInvalidator
+// This class provides policy invalidations for a |CloudPolicyCore| that wishes
+// to use a shared |InvalidationService| affiliated with the device's enrollment
+// domain. This is the case e.g. for device policy and device-local account
+// policy.
+// It relies on an |AffiliatedInvalidationServiceProvider| to provide it with
+// access to a shared |InvalidationService| to back the
+// |CloudPolicyInvalidator|. Whenever the shared |InvalidationService| changes,
+// the |CloudPolicyInvalidator| is destroyed and re-created.
+class AffiliatedCloudPolicyInvalidator
: public AffiliatedInvalidationServiceProvider::Consumer {
public:
- explicit DeviceCloudPolicyInvalidator(
+ AffiliatedCloudPolicyInvalidator(
+ enterprise_management::DeviceRegisterRequest::Type type,
+ CloudPolicyCore* core,
AffiliatedInvalidationServiceProvider* invalidation_service_provider);
- ~DeviceCloudPolicyInvalidator() override;
+ ~AffiliatedCloudPolicyInvalidator() override;
// AffiliatedInvalidationServiceProvider::Consumer:
void OnInvalidationServiceSet(
@@ -45,7 +51,10 @@ class DeviceCloudPolicyInvalidator
// Destroy the current |CloudPolicyInvalidator|, if any.
void DestroyInvalidator();
- AffiliatedInvalidationServiceProvider* invalidation_service_provider_;
+ const enterprise_management::DeviceRegisterRequest::Type type_;
+ CloudPolicyCore* const core_;
+
+ AffiliatedInvalidationServiceProvider* const invalidation_service_provider_;
// The highest invalidation version that was handled already.
int64 highest_handled_invalidation_version_;
@@ -54,9 +63,9 @@ class DeviceCloudPolicyInvalidator
// service is available.
scoped_ptr<CloudPolicyInvalidator> invalidator_;
- DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyInvalidator);
+ DISALLOW_COPY_AND_ASSIGN(AffiliatedCloudPolicyInvalidator);
};
} // namespace policy
-#endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INVALIDATOR_H_
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATED_CLOUD_POLICY_INVALIDATOR_H_
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698