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

Side by Side Diff: components/policy/core/browser/policy_error_map.cc

Issue 112433004: Update uses of UTF conversions in chrome_frame/, chromeos/, components/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
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 #include "components/policy/core/browser/policy_error_map.h" 5 #include "components/policy/core/browser/policy_error_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 Convert(error); 131 Convert(error);
132 } else { 132 } else {
133 pending_.push_back(error); 133 pending_.push_back(error);
134 } 134 }
135 } 135 }
136 136
137 void PolicyErrorMap::Convert(const PendingError& error) { 137 void PolicyErrorMap::Convert(const PendingError& error) {
138 base::string16 submessage; 138 base::string16 submessage;
139 if (error.has_replacement) { 139 if (error.has_replacement) {
140 submessage = l10n_util::GetStringFUTF16(error.message_id, 140 submessage = l10n_util::GetStringFUTF16(error.message_id,
141 ASCIIToUTF16(error.replacement)); 141 base::ASCIIToUTF16(
142 error.replacement));
142 } else { 143 } else {
143 submessage = l10n_util::GetStringUTF16(error.message_id); 144 submessage = l10n_util::GetStringUTF16(error.message_id);
144 } 145 }
145 base::string16 message; 146 base::string16 message;
146 if (!error.subkey.empty()) { 147 if (!error.subkey.empty()) {
147 message = l10n_util::GetStringFUTF16(IDS_POLICY_SUBKEY_ERROR, 148 message = l10n_util::GetStringFUTF16(IDS_POLICY_SUBKEY_ERROR,
148 ASCIIToUTF16(error.subkey), 149 base::ASCIIToUTF16(error.subkey),
149 submessage); 150 submessage);
150 } else if (error.index >= 0) { 151 } else if (error.index >= 0) {
151 message = l10n_util::GetStringFUTF16(IDS_POLICY_LIST_ENTRY_ERROR, 152 message = l10n_util::GetStringFUTF16(IDS_POLICY_LIST_ENTRY_ERROR,
152 base::IntToString16(error.index), 153 base::IntToString16(error.index),
153 submessage); 154 submessage);
154 } else { 155 } else {
155 message = submessage; 156 message = submessage;
156 } 157 }
157 map_.insert(std::make_pair(error.policy, message)); 158 map_.insert(std::make_pair(error.policy, message));
158 } 159 }
159 160
160 void PolicyErrorMap::CheckReadyAndConvert() { 161 void PolicyErrorMap::CheckReadyAndConvert() {
161 DCHECK(IsReady()); 162 DCHECK(IsReady());
162 for (size_t i = 0; i < pending_.size(); ++i) { 163 for (size_t i = 0; i < pending_.size(); ++i) {
163 Convert(pending_[i]); 164 Convert(pending_[i]);
164 } 165 }
165 pending_.clear(); 166 pending_.clear();
166 } 167 }
167 168
168 } // namespace policy 169 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698