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

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

Issue 8555009: Fix display and progressive disclosure for multi-line values in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 9 years, 1 month 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/resources/policy.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "chrome/browser/policy/policy_error_map.h" 5 #include "chrome/browser/policy/policy_error_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const std::string& replacement) { 50 const std::string& replacement) {
51 AddError(PendingError(policy, message_id, ASCIIToUTF16(replacement))); 51 AddError(PendingError(policy, message_id, ASCIIToUTF16(replacement)));
52 } 52 }
53 53
54 string16 PolicyErrorMap::GetErrors(ConfigurationPolicyType policy) { 54 string16 PolicyErrorMap::GetErrors(ConfigurationPolicyType policy) {
55 CheckReadyAndConvert(); 55 CheckReadyAndConvert();
56 std::pair<const_iterator, const_iterator> range = map_.equal_range(policy); 56 std::pair<const_iterator, const_iterator> range = map_.equal_range(policy);
57 std::vector<string16> list; 57 std::vector<string16> list;
58 for (const_iterator it = range.first; it != range.second; ++it) 58 for (const_iterator it = range.first; it != range.second; ++it)
59 list.push_back(it->second); 59 list.push_back(it->second);
60 return JoinString(list, ' '); 60 return JoinString(list, '\n');
61 } 61 }
62 62
63 bool PolicyErrorMap::empty() { 63 bool PolicyErrorMap::empty() {
64 CheckReadyAndConvert(); 64 CheckReadyAndConvert();
65 return map_.empty(); 65 return map_.empty();
66 } 66 }
67 67
68 size_t PolicyErrorMap::size() { 68 size_t PolicyErrorMap::size() {
69 CheckReadyAndConvert(); 69 CheckReadyAndConvert();
70 return map_.size(); 70 return map_.size();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 void PolicyErrorMap::CheckReadyAndConvert() { 105 void PolicyErrorMap::CheckReadyAndConvert() {
106 DCHECK(IsReady()); 106 DCHECK(IsReady());
107 for (size_t i = 0; i < pending_.size(); ++i) { 107 for (size_t i = 0; i < pending_.size(); ++i) {
108 Convert(pending_[i]); 108 Convert(pending_[i]);
109 } 109 }
110 pending_.clear(); 110 pending_.clear();
111 } 111 }
112 112
113 } // namespace policy 113 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/resources/policy.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698