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

Side by Side Diff: components/policy/core/browser/configuration_policy_handler.h

Issue 2151793002: Add base::Value::GetTypeName(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments, fix build Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ 5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_
6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ 6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 18 matching lines...) Expand all
29 struct POLICY_EXPORT PolicyToPreferenceMapEntry { 29 struct POLICY_EXPORT PolicyToPreferenceMapEntry {
30 const char* const policy_name; 30 const char* const policy_name;
31 const char* const preference_path; 31 const char* const preference_path;
32 const base::Value::Type value_type; 32 const base::Value::Type value_type;
33 }; 33 };
34 34
35 // An abstract super class that subclasses should implement to map policies to 35 // An abstract super class that subclasses should implement to map policies to
36 // their corresponding preferences, and to check whether the policies are valid. 36 // their corresponding preferences, and to check whether the policies are valid.
37 class POLICY_EXPORT ConfigurationPolicyHandler { 37 class POLICY_EXPORT ConfigurationPolicyHandler {
38 public: 38 public:
39 // TODO(thestig): Replace with base::Value::GetTypeName().
39 static std::string ValueTypeToString(base::Value::Type type); 40 static std::string ValueTypeToString(base::Value::Type type);
40 41
41 ConfigurationPolicyHandler(); 42 ConfigurationPolicyHandler();
42 virtual ~ConfigurationPolicyHandler(); 43 virtual ~ConfigurationPolicyHandler();
43 44
44 // Returns whether the policy settings handled by this 45 // Returns whether the policy settings handled by this
45 // ConfigurationPolicyHandler can be applied. Fills |errors| with error 46 // ConfigurationPolicyHandler can be applied. Fills |errors| with error
46 // messages or warnings. |errors| may contain error messages even when 47 // messages or warnings. |errors| may contain error messages even when
47 // |CheckPolicySettings()| returns true. 48 // |CheckPolicySettings()| returns true.
48 virtual bool CheckPolicySettings(const PolicyMap& policies, 49 virtual bool CheckPolicySettings(const PolicyMap& policies,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 private: 355 private:
355 ScopedVector<ConfigurationPolicyHandler> legacy_policy_handlers_; 356 ScopedVector<ConfigurationPolicyHandler> legacy_policy_handlers_;
356 std::unique_ptr<SchemaValidatingPolicyHandler> new_policy_handler_; 357 std::unique_ptr<SchemaValidatingPolicyHandler> new_policy_handler_;
357 358
358 DISALLOW_COPY_AND_ASSIGN(LegacyPoliciesDeprecatingPolicyHandler); 359 DISALLOW_COPY_AND_ASSIGN(LegacyPoliciesDeprecatingPolicyHandler);
359 }; 360 };
360 361
361 } // namespace policy 362 } // namespace policy
362 363
363 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_ 364 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698