OLD | NEW |
---|---|
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 CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_ | 5 #ifndef CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_ |
6 #define CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_ | 6 #define CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... | |
32 // Adds an entry with key |policy| and the error message corresponding to | 32 // Adds an entry with key |policy| and the error message corresponding to |
33 // |message_id| in grit/generated_resources.h to the map. | 33 // |message_id| in grit/generated_resources.h to the map. |
34 void AddError(const std::string& policy, int message_id); | 34 void AddError(const std::string& policy, int message_id); |
35 | 35 |
36 // Adds an entry with key |policy|, subkey |subkey|, and the error message | 36 // Adds an entry with key |policy|, subkey |subkey|, and the error message |
37 // corresponding to |message_id| in grit/generated_resources.h to the map. | 37 // corresponding to |message_id| in grit/generated_resources.h to the map. |
38 void AddError(const std::string& policy, | 38 void AddError(const std::string& policy, |
39 const std::string& subkey, | 39 const std::string& subkey, |
40 int message_id); | 40 int message_id); |
41 | 41 |
42 // Adds an entry with key |policy|, list index |index|, and the error message | |
43 // corresponding to |message_id| in grit/generated_resources.h to the map. | |
44 void AddError(const std::string& policy, | |
45 int index, | |
46 int message_id); | |
47 | |
42 // Adds an entry with key |policy| and the error message corresponding to | 48 // Adds an entry with key |policy| and the error message corresponding to |
43 // |message_id| in grit/generated_resources.h to the map and replaces the | 49 // |message_id| in grit/generated_resources.h to the map and replaces the |
44 // placeholder within the error message with |replacement_string|. | 50 // placeholder within the error message with |replacement_string|. |
45 void AddError(const std::string& policy, | 51 void AddError(const std::string& policy, |
46 int message_id, | 52 int message_id, |
47 const std::string& replacement_string); | 53 const std::string& replacement_string); |
48 | 54 |
49 // Adds an entry with key |policy|, subkey |subkey| and the error message | 55 // Adds an entry with key |policy|, subkey |subkey| and the error message |
50 // corresponding to |message_id| in grit/generated_resources.h to the map. | 56 // corresponding to |message_id| in grit/generated_resources.h to the map. |
51 // Replaces the placeholder in the error message with |replacement_string|. | 57 // Replaces the placeholder in the error message with |replacement_string|. |
52 void AddError(const std::string& policy, | 58 void AddError(const std::string& policy, |
53 const std::string& subkey, | 59 const std::string& subkey, |
54 int message_id, | 60 int message_id, |
55 const std::string& replacement_string); | 61 const std::string& replacement_string); |
56 | 62 |
63 // Adds an entry with key |policy|, list index |index| and the error message | |
64 // corresponding to |message_id| in grit/generated_resources.h to the map. | |
65 // Replaces the placeholder in the error message with |replacement_string|. | |
66 void AddError(const std::string& policy, | |
67 int index, | |
68 int message_id, | |
69 const std::string& replacement_string); | |
70 | |
71 | |
Joao da Silva
2012/05/03 18:41:22
nit: one newline
Mattias Nissler (ping if slow)
2012/05/03 20:13:04
Done.
| |
57 // Returns all the error messages stored for |policy|, separated by a white | 72 // Returns all the error messages stored for |policy|, separated by a white |
58 // space. Returns an empty string if there are no errors for |policy|. | 73 // space. Returns an empty string if there are no errors for |policy|. |
59 string16 GetErrors(const std::string& policy); | 74 string16 GetErrors(const std::string& policy); |
60 | 75 |
61 bool empty(); | 76 bool empty(); |
62 size_t size(); | 77 size_t size(); |
63 | 78 |
64 const_iterator begin(); | 79 const_iterator begin(); |
65 const_iterator end(); | 80 const_iterator end(); |
66 | 81 |
(...skipping 13 matching lines...) Expand all Loading... | |
80 | 95 |
81 std::vector<PendingError> pending_; | 96 std::vector<PendingError> pending_; |
82 PolicyMapType map_; | 97 PolicyMapType map_; |
83 | 98 |
84 DISALLOW_COPY_AND_ASSIGN(PolicyErrorMap); | 99 DISALLOW_COPY_AND_ASSIGN(PolicyErrorMap); |
85 }; | 100 }; |
86 | 101 |
87 } // namespace policy | 102 } // namespace policy |
88 | 103 |
89 #endif // CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_ | 104 #endif // CHROME_BROWSER_POLICY_POLICY_ERROR_MAP_H_ |
OLD | NEW |