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

Unified Diff: chrome/browser/mock_configuration_policy_store.h

Issue 2027010: Preference provider implementation backed by JSON files in a directory. (Closed)
Patch Set: A few more fixes. Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/configuration_policy_provider.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mock_configuration_policy_store.h
diff --git a/chrome/browser/mock_configuration_policy_store.h b/chrome/browser/mock_configuration_policy_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..b1f36964bb2a1c2ee924df188c631abced478de8
--- /dev/null
+++ b/chrome/browser/mock_configuration_policy_store.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2010 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_MOCK_CONFIGURATION_POLICY_STORE_H_
+#define CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_
+
+#include <map>
+
+#include "base/stl_util-inl.h"
+#include "chrome/browser/configuration_policy_store.h"
+
+// Mock ConfigurationPolicyStore implementation that records values for policy
+// settings as they get set.
+class MockConfigurationPolicyStore : public ConfigurationPolicyStore {
+ public:
+ MockConfigurationPolicyStore() {}
+ ~MockConfigurationPolicyStore() {
+ STLDeleteValues(&policy_map_);
+ }
+
+ typedef std::map<ConfigurationPolicyStore::PolicyType, Value*> PolicyMap;
+ const PolicyMap& policy_map() { return policy_map_; }
+
+ // ConfigurationPolicyStore implementation.
+ virtual void Apply(PolicyType policy, Value* value) {
+ policy_map_[policy] = value;
+ }
+
+ private:
+ PolicyMap policy_map_;
+};
+
+#endif // CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_
« no previous file with comments | « chrome/browser/configuration_policy_provider.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698