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

Side by Side Diff: chrome/browser/policy/policy_error_map.h

Issue 7972013: ConfigurationPolicyPrefStore refactoring to surface error messages. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_
6 #define CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_
7 #pragma once
8
9 #include <map>
10
11 #include "base/values.h"
12 #include "policy/configuration_policy_type.h"
13
14 namespace policy {
15
16 // Wrapper class around a std::multimap<ConfigurationPolicyType, StringValue*>
17 // used to associate policies with error messages generated when a policy fails
18 // to be applied.
19 class PolicyErrorMap {
20 public:
21 typedef std::multimap<ConfigurationPolicyType, StringValue*> PolicyMapType;
Mattias Nissler (ping if slow) 2011/09/20 13:12:25 Why is this a StringValue* instead of a plain stri
simo 2011/09/22 11:43:26 For some reason I was thinking I needed to put Str
22 typedef PolicyMapType::const_iterator const_iterator;
23
24 PolicyErrorMap();
25 virtual ~PolicyErrorMap();
26
27 // Takes ownership of |error_message|.
28 void AddError(ConfigurationPolicyType policy, StringValue* error_message);
29
30 // Returns a list of all the error messages stored for |policy|. The caller
31 // acquires ownership of the returned ListValue pointer.
32 ListValue* GetErrors(ConfigurationPolicyType policy) const;
33
34 bool empty() const;
35 size_t size() const;
36
37 const_iterator begin() const;
38 const_iterator end() const;
39
40 void Clear();
41
42 private:
43 PolicyMapType map_;
44
45 DISALLOW_COPY_AND_ASSIGN(PolicyErrorMap);
Mattias Nissler (ping if slow) 2011/09/20 13:12:25 #include "base/basic_types.h"
simo 2011/09/22 11:43:26 I couldn't find "base/basic_types.h" but I include
46 };
47
48 } // namespace policy
49
50 #endif // CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698