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

Unified Diff: chrome/browser/policy/device_policy_cache.h

Issue 6705031: Send policy blobs to session_manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits Created 9 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
« no previous file with comments | « chrome/browser/policy/cloud_policy_subsystem.cc ('k') | chrome/browser/policy/device_policy_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/device_policy_cache.h
diff --git a/chrome/browser/policy/device_policy_cache.h b/chrome/browser/policy/device_policy_cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..f6a951435739356e64cb6caae2133af2a32275ee
--- /dev/null
+++ b/chrome/browser/policy/device_policy_cache.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2011 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_DEVICE_POLICY_CACHE_H_
+#define CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_
+#pragma once
+
+#include <string>
+
+#include "chrome/browser/chromeos/login/signed_settings.h"
+#include "chrome/browser/chromeos/login/signed_settings_helper.h"
+#include "chrome/browser/policy/cloud_policy_cache_base.h"
+#include "chrome/browser/policy/proto/chrome_device_policy.pb.h"
+
+namespace policy {
+
+class PolicyMap;
+
+namespace em = enterprise_management;
+
+// CloudPolicyCacheBase implementation that persists policy information
+// to ChromeOS' session manager (via SignedSettingsHelper).
+class DevicePolicyCache : public CloudPolicyCacheBase,
+ public chromeos::SignedSettingsHelper::Callback {
+ public:
+ DevicePolicyCache();
+ virtual ~DevicePolicyCache();
+
+ // CloudPolicyCacheBase implementation:
+ virtual void Load() OVERRIDE;
+ virtual void SetPolicy(const em::PolicyFetchResponse& policy) OVERRIDE;
+ virtual void SetUnmanaged() OVERRIDE;
+
+ // SignedSettingsHelper::Callback implementation:
+ virtual void OnStorePolicyCompleted(
+ chromeos::SignedSettings::ReturnCode code) OVERRIDE;
+ virtual void OnRetrievePolicyCompleted(
+ chromeos::SignedSettings::ReturnCode code,
+ const em::PolicyFetchResponse& policy) OVERRIDE;
+
+ private:
+ friend class DevicePolicyCacheTest;
+
+ // Alternate c'tor allowing tests to mock out the SignedSettingsHelper
+ // singleton.
+ explicit DevicePolicyCache(
+ chromeos::SignedSettingsHelper* signed_settings_helper);
+
+ // CloudPolicyCacheBase implementation:
+ virtual bool DecodePolicyData(const em::PolicyData& policy_data,
+ PolicyMap* mandatory,
+ PolicyMap* recommended) OVERRIDE;
+
+ static void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy,
+ PolicyMap* mandatory,
+ PolicyMap* recommended);
+
+ chromeos::SignedSettingsHelper* signed_settings_helper_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevicePolicyCache);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_DEVICE_POLICY_CACHE_H_
« no previous file with comments | « chrome/browser/policy/cloud_policy_subsystem.cc ('k') | chrome/browser/policy/device_policy_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698