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

Unified Diff: chrome/common/extensions/extension.h

Issue 10536084: Add a warning when developing an extension that uses old manifest version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blonk Created 8 years, 6 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/chrome_tests.gypi ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.h
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 6fac262e5f9a2f80751248e041d860442e353290..4216e37fd34761d97111381fb08869773edd00b2 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -55,9 +55,12 @@ class Manifest;
// Represents a Chrome extension.
class Extension : public base::RefCountedThreadSafe<Extension> {
public:
+ struct InstallWarning;
+
typedef std::map<const std::string, GURL> URLOverrideMap;
typedef std::vector<std::string> ScriptingWhitelist;
typedef std::vector<linked_ptr<FileBrowserHandler> > FileBrowserHandlerList;
+ typedef std::vector<InstallWarning> InstallWarningVector;
// What an extension was loaded from.
// NOTE: These values are stored as integers in the preferences and used
@@ -182,6 +185,20 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
std::vector<std::string> scopes;
};
+ struct InstallWarning {
+ enum Format {
+ // IMPORTANT: Do not build HTML strings from user or developer-supplied
+ // input.
+ FORMAT_TEXT,
+ FORMAT_HTML,
+ };
+ InstallWarning(Format format, const std::string& message)
+ : format(format), message(message) {
+ }
+ Format format;
+ std::string message;
+ };
+
enum InitFromValueFlags {
NO_FLAGS = 0,
@@ -611,8 +628,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
return required_permission_set_.get();
}
// Appends |new_warnings| to install_warnings().
- void AddInstallWarnings(const std::vector<std::string>& new_warnings);
- const std::vector<std::string>& install_warnings() const {
+ void AddInstallWarnings(const InstallWarningVector& new_warnings);
+ const InstallWarningVector& install_warnings() const {
return install_warnings_;
}
const GURL& update_url() const { return update_url_; }
@@ -903,7 +920,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
scoped_refptr<const ExtensionPermissionSet> required_permission_set_;
// Any warnings that occurred when trying to create/parse the extension.
- std::vector<std::string> install_warnings_;
+ InstallWarningVector install_warnings_;
// The icons for the extension.
ExtensionIconSet icons_;
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698