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

Unified Diff: extensions/common/install_warning.h

Issue 22470007: Add a "key" entry to InstallWarnings, remove InstallWarning::Format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ec_infrastructure
Patch Set: Created 7 years, 4 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/common/extensions/permissions/permissions_data.cc ('k') | extensions/common/install_warning.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/install_warning.h
diff --git a/extensions/common/install_warning.h b/extensions/common/install_warning.h
index fb3fccb29b6e6de7be242e83b0295aff933f9d24..7b7b2f342572d3d107c1615cc5ebea50b6731326 100644
--- a/extensions/common/install_warning.h
+++ b/extensions/common/install_warning.h
@@ -11,22 +11,24 @@
namespace extensions {
struct InstallWarning {
- enum Format {
- // IMPORTANT: Do not build HTML strings from user or developer-supplied
- // input.
- FORMAT_TEXT,
- FORMAT_HTML,
- };
- static InstallWarning Text(const std::string& message) {
- return InstallWarning(FORMAT_TEXT, message);
- }
- InstallWarning(Format format, const std::string& message)
- : format(format), message(message) {
- }
+ InstallWarning(const std::string& message);
+ InstallWarning(const std::string& key,
Yoyo Zhou 2013/08/14 22:40:36 This is slightly unintuitive. Usually when you all
Devlin 2013/08/15 00:20:26 Done.
+ const std::string& message);
+ InstallWarning(const std::string& key,
+ const std::string& specific,
+ const std::string& message);
+ ~InstallWarning();
+
bool operator==(const InstallWarning& other) const {
- return format == other.format && message == other.message;
+ return message == other.message;
Yoyo Zhou 2013/08/14 22:40:36 Maybe comment why this is appropriate and we can i
Devlin 2013/08/15 00:20:26 Done.
}
- Format format;
+
+ // The manifest key to which this warning pertains (e.g., 'permissions').
Yoyo Zhou 2013/08/14 22:40:36 This is also optional, right?
Devlin 2013/08/15 00:20:26 Done.
+ std::string key;
+ // Optional. The specific portion of the key which caused the warning. For
+ // instance, a single faulty permission in the 'permissions' key.
+ std::string specific;
+ // The warning's message.
std::string message;
};
« no previous file with comments | « chrome/common/extensions/permissions/permissions_data.cc ('k') | extensions/common/install_warning.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698