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

Unified Diff: chrome/browser/policy/policy_error_map.cc

Issue 10316022: Wire up the policy for controlling pinned apps in the ash launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/policy_error_map.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_error_map.cc
diff --git a/chrome/browser/policy/policy_error_map.cc b/chrome/browser/policy/policy_error_map.cc
index 5dc54b42da90123cf4fe9b8c55e902dca9ddd37a..a0514daf2ab17ab3a5e6fc211a73eb83f790b673 100644
--- a/chrome/browser/policy/policy_error_map.cc
+++ b/chrome/browser/policy/policy_error_map.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "grit/generated_resources.h"
@@ -17,24 +18,29 @@ namespace policy {
struct PolicyErrorMap::PendingError {
PendingError(const std::string& policy,
const std::string& subkey,
+ int index,
int message_id,
const std::string& replacement)
: policy(policy),
subkey(subkey),
+ index(index),
message_id(message_id),
has_replacement(true),
replacement(replacement) {}
PendingError(const std::string& policy,
const std::string& subkey,
+ int index,
int message_id)
: policy(policy),
subkey(subkey),
+ index(index),
message_id(message_id),
has_replacement(false) {}
std::string policy;
std::string subkey;
+ int index;
int message_id;
bool has_replacement;
std::string replacement;
@@ -51,26 +57,39 @@ bool PolicyErrorMap::IsReady() const {
}
void PolicyErrorMap::AddError(const std::string& policy, int message_id) {
- AddError(PendingError(policy, std::string(), message_id));
+ AddError(PendingError(policy, std::string(), -1, message_id));
}
void PolicyErrorMap::AddError(const std::string& policy,
const std::string& subkey,
int message_id) {
- AddError(PendingError(policy, subkey, message_id));
+ AddError(PendingError(policy, subkey, -1, message_id));
+}
+
+void PolicyErrorMap::AddError(const std::string& policy,
+ int index,
+ int message_id) {
+ AddError(PendingError(policy, std::string(), index, message_id));
}
void PolicyErrorMap::AddError(const std::string& policy,
int message_id,
const std::string& replacement) {
- AddError(PendingError(policy, std::string(), message_id, replacement));
+ AddError(PendingError(policy, std::string(), -1, message_id, replacement));
}
void PolicyErrorMap::AddError(const std::string& policy,
const std::string& subkey,
int message_id,
const std::string& replacement) {
- AddError(PendingError(policy, subkey, message_id, replacement));
+ AddError(PendingError(policy, subkey, -1, message_id, replacement));
+}
+
+void PolicyErrorMap::AddError(const std::string& policy,
+ int index,
+ int message_id,
+ const std::string& replacement) {
+ AddError(PendingError(policy, std::string(), index, message_id, replacement));
}
string16 PolicyErrorMap::GetErrors(const std::string& policy) {
@@ -128,6 +147,10 @@ void PolicyErrorMap::Convert(const PendingError& error) {
message = l10n_util::GetStringFUTF16(IDS_POLICY_SUBKEY_ERROR,
ASCIIToUTF16(error.subkey),
submessage);
+ } else if (error.index >= 0) {
+ message = l10n_util::GetStringFUTF16(IDS_POLICY_LIST_ENTRY_ERROR,
+ base::IntToString16(error.index),
+ submessage);
} else {
message = submessage;
}
« no previous file with comments | « chrome/browser/policy/policy_error_map.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698