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

Side by Side Diff: chrome/browser/policy/test/policy_test_utils.h

Issue 58313002: Removed the PolicyDefinitionList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-10-use-registry
Patch Set: rebase Created 7 years, 1 month 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_POLICY_POLICY_TEST_UTILS_H_ 5 #ifndef CHROME_BROWSER_POLICY_TEST_POLICY_TEST_UTILS_H_
6 #define CHROME_BROWSER_POLICY_POLICY_TEST_UTILS_H_ 6 #define CHROME_BROWSER_POLICY_TEST_POLICY_TEST_UTILS_H_
7 7
8 #include <map>
8 #include <ostream> 9 #include <ostream>
10 #include <string>
9 11
12 #include "base/basictypes.h"
10 #include "chrome/browser/policy/policy_map.h" 13 #include "chrome/browser/policy/policy_map.h"
11 #include "chrome/browser/policy/policy_service.h" 14 #include "chrome/browser/policy/policy_service.h"
12 #include "chrome/browser/policy/policy_types.h" 15 #include "chrome/browser/policy/policy_types.h"
16 #include "policy/policy_constants.h"
13 17
14 namespace policy { 18 namespace policy {
15 19
16 class PolicyBundle; 20 class PolicyBundle;
17 struct PolicyNamespace; 21 struct PolicyNamespace;
18 22
23 // A mapping of policy names to PolicyDetails that can be used to set the
24 // PolicyDetails for test policies.
25 class PolicyDetailsMap {
26 public:
27 PolicyDetailsMap();
28 ~PolicyDetailsMap();
29
30 // The returned callback's lifetime is tied to |this| object.
31 GetChromePolicyDetailsCallback GetCallback() const;
32
33 // Does not take ownership of |details|.
34 void SetDetails(const std::string& policy, const PolicyDetails* details);
35
36 private:
37 typedef std::map<std::string, const PolicyDetails*> PolicyDetailsMapping;
38
39 const PolicyDetails* Lookup(const std::string& policy) const;
40
41 PolicyDetailsMapping map_;
42
43 DISALLOW_COPY_AND_ASSIGN(PolicyDetailsMap);
44 };
45
19 // Returns true if |service| is not serving any policies. Otherwise logs the 46 // Returns true if |service| is not serving any policies. Otherwise logs the
20 // current policies and returns false. 47 // current policies and returns false.
21 bool PolicyServiceIsEmpty(const PolicyService* service); 48 bool PolicyServiceIsEmpty(const PolicyService* service);
22 49
23 } // namespace policy 50 } // namespace policy
24 51
25 std::ostream& operator<<(std::ostream& os, const policy::PolicyBundle& bundle); 52 std::ostream& operator<<(std::ostream& os, const policy::PolicyBundle& bundle);
26 std::ostream& operator<<(std::ostream& os, policy::PolicyScope scope); 53 std::ostream& operator<<(std::ostream& os, policy::PolicyScope scope);
27 std::ostream& operator<<(std::ostream& os, policy::PolicyLevel level); 54 std::ostream& operator<<(std::ostream& os, policy::PolicyLevel level);
28 std::ostream& operator<<(std::ostream& os, policy::PolicyDomain domain); 55 std::ostream& operator<<(std::ostream& os, policy::PolicyDomain domain);
29 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap& policies); 56 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap& policies);
30 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e); 57 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e);
31 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns); 58 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns);
32 59
33 #endif // CHROME_BROWSER_POLICY_POLICY_TEST_UTILS_H_ 60 #endif // CHROME_BROWSER_POLICY_TEST_POLICY_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_test_utils.cc ('k') | chrome/browser/policy/test/policy_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698