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

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

Issue 6840014: Support decoding GenericNamedValue based policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test broken by patch set 2 Created 9 years, 8 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/proto/old_generic_format.proto ('k') | chrome/browser/policy/user_policy_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/user_policy_cache.h
diff --git a/chrome/browser/policy/user_policy_cache.h b/chrome/browser/policy/user_policy_cache.h
index 316497fe0dcafa1b88cbe95b001f9e3da6c00ab4..3d6b56bcd92764f7f176ced7aa9b518393aedbde 100644
--- a/chrome/browser/policy/user_policy_cache.h
+++ b/chrome/browser/policy/user_policy_cache.h
@@ -6,9 +6,17 @@
#define CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_
#pragma once
+#include <string>
+
#include "base/file_path.h"
#include "chrome/browser/policy/cloud_policy_cache_base.h"
+// <Old-style policy support> (see comment below)
+namespace enterprise_management {
+class GenericValue;
+} // namespace enterprise_management
+// </Old-style policy support>
+
namespace policy {
// CloudPolicyCacheBase implementation that persists policy information
@@ -32,6 +40,23 @@ class UserPolicyCache : public CloudPolicyCacheBase {
PolicyMap* mandatory,
PolicyMap* recommended) OVERRIDE;
+ // <Old-style policy support>
+ // The following member functions are needed to support old-style policy and
+ // can be removed once all server-side components (CPanel, D3) have been
+ // migrated to providing the new policy format.
+
+ // If |mandatory| and |recommended| are both empty, and |policy_data|
+ // contains a field named "repeated GenericNamedValue named_value = 2;",
+ // this field is decoded into |mandatory|.
+ void MaybeDecodeOldstylePolicy(const std::string& policy_data,
+ PolicyMap* mandatory,
+ PolicyMap* recommended);
+
+ Value* DecodeIntegerValue(google::protobuf::int64 value) const;
+ Value* DecodeValue(const em::GenericValue& value) const;
+
+ // </Old-style policy support>
+
// The file in which we store a cached version of the policy information.
const FilePath backing_file_path_;
« no previous file with comments | « chrome/browser/policy/proto/old_generic_format.proto ('k') | chrome/browser/policy/user_policy_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698