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 #include "components/policy/core/browser/cloud/message_util.h" | 5 #include "components/policy/core/browser/cloud/message_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "grit/component_strings.h" | 8 #include "grit/component_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 case CloudPolicyValidatorBase::VALIDATION_WRONG_SETTINGS_ENTITY_ID: | 66 case CloudPolicyValidatorBase::VALIDATION_WRONG_SETTINGS_ENTITY_ID: |
67 return IDS_POLICY_VALIDATION_WRONG_SETTINGS_ENTITY_ID; | 67 return IDS_POLICY_VALIDATION_WRONG_SETTINGS_ENTITY_ID; |
68 case CloudPolicyValidatorBase::VALIDATION_BAD_TIMESTAMP: | 68 case CloudPolicyValidatorBase::VALIDATION_BAD_TIMESTAMP: |
69 return IDS_POLICY_VALIDATION_BAD_TIMESTAMP; | 69 return IDS_POLICY_VALIDATION_BAD_TIMESTAMP; |
70 case CloudPolicyValidatorBase::VALIDATION_WRONG_TOKEN: | 70 case CloudPolicyValidatorBase::VALIDATION_WRONG_TOKEN: |
71 return IDS_POLICY_VALIDATION_WRONG_TOKEN; | 71 return IDS_POLICY_VALIDATION_WRONG_TOKEN; |
72 case CloudPolicyValidatorBase::VALIDATION_BAD_USERNAME: | 72 case CloudPolicyValidatorBase::VALIDATION_BAD_USERNAME: |
73 return IDS_POLICY_VALIDATION_BAD_USERNAME; | 73 return IDS_POLICY_VALIDATION_BAD_USERNAME; |
74 case CloudPolicyValidatorBase::VALIDATION_POLICY_PARSE_ERROR: | 74 case CloudPolicyValidatorBase::VALIDATION_POLICY_PARSE_ERROR: |
75 return IDS_POLICY_VALIDATION_POLICY_PARSE_ERROR; | 75 return IDS_POLICY_VALIDATION_POLICY_PARSE_ERROR; |
| 76 case CloudPolicyValidatorBase::VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE: |
| 77 return IDS_POLICY_VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE; |
| 78 case CloudPolicyValidatorBase::VALIDATION_STATUS_SIZE: |
| 79 NOTREACHED(); |
76 } | 80 } |
77 NOTREACHED() << "Unhandled validation status " << status; | 81 NOTREACHED() << "Unhandled validation status " << status; |
78 return IDS_POLICY_VALIDATION_UNKNOWN_ERROR; | 82 return IDS_POLICY_VALIDATION_UNKNOWN_ERROR; |
79 } | 83 } |
80 | 84 |
81 int GetIDSForStoreStatus(CloudPolicyStore::Status status) { | 85 int GetIDSForStoreStatus(CloudPolicyStore::Status status) { |
82 switch (status) { | 86 switch (status) { |
83 case CloudPolicyStore::STATUS_OK: | 87 case CloudPolicyStore::STATUS_OK: |
84 return IDS_POLICY_STORE_STATUS_OK; | 88 return IDS_POLICY_STORE_STATUS_OK; |
85 case CloudPolicyStore::STATUS_LOAD_ERROR: | 89 case CloudPolicyStore::STATUS_LOAD_ERROR: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return l10n_util::GetStringFUTF16( | 123 return l10n_util::GetStringFUTF16( |
120 IDS_POLICY_STORE_STATUS_VALIDATION_ERROR, | 124 IDS_POLICY_STORE_STATUS_VALIDATION_ERROR, |
121 l10n_util::GetStringUTF16( | 125 l10n_util::GetStringUTF16( |
122 GetIDSForValidationStatus(validation_status))); | 126 GetIDSForValidationStatus(validation_status))); |
123 } | 127 } |
124 | 128 |
125 return l10n_util::GetStringUTF16(GetIDSForStoreStatus(store_status)); | 129 return l10n_util::GetStringUTF16(GetIDSForStoreStatus(store_status)); |
126 } | 130 } |
127 | 131 |
128 } // namespace policy | 132 } // namespace policy |
OLD | NEW |