Unrevert 11294.
- include stub fix so that linux/mac still build.
- fix DCHECK in views code.
- fix unit test.
Review URL: http://codereview.chromium.org/41020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11360 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension.h b/chrome/browser/extensions/extension.h
index 5ca86d3..87290ca 100644
--- a/chrome/browser/extensions/extension.h
+++ b/chrome/browser/extensions/extension.h
@@ -42,6 +42,7 @@
static const wchar_t* kZipHashKey;
static const wchar_t* kPluginsDirKey;
static const wchar_t* kThemeKey;
+ static const wchar_t* kToolstripKey;
// Some values expected in manifests.
static const char* kRunAtDocumentStartValue;
@@ -65,6 +66,7 @@
static const char* kInvalidVersionError;
static const char* kInvalidZipHashError;
static const char* kInvalidPluginsDirError;
+ static const char* kInvalidToolstripError;
// The number of bytes in a legal id.
static const size_t kIdSize;
@@ -85,6 +87,9 @@
static FilePath GetResourcePath(const FilePath& extension_path,
const std::string& relative_path);
+ // Initialize the extension from a parsed manifest.
+ bool InitFromValue(const DictionaryValue& value, std::string* error);
+
// Returns an absolute path to a resource inside of an extension if the
// extension has a theme defined with the given |resource_id|. Otherwise
// the path will be empty. Note that this method is not static as it is
@@ -92,11 +97,24 @@
// as providing a theme.
FilePath GetThemeResourcePath(const int resource_id);
- // The path to the folder the extension is stored in.
const FilePath& path() const { return path_; }
-
- // The base URL for the extension.
const GURL& url() const { return extension_url_; }
+ const std::string& id() const { return id_; }
+ const Version* version() const { return version_.get(); }
+ // String representation of the version number.
+ const std::string VersionString() const;
+ const std::string& name() const { return name_; }
+ const std::string& description() const { return description_; }
+ const UserScriptList& content_scripts() const { return content_scripts_; }
+ const FilePath& plugins_dir() const { return plugins_dir_; }
+ const GURL& toolstrip_url() const { return toolstrip_url_; }
+
+ private:
+ // The absolute path to the directory the extension is stored in.
+ FilePath path_;
+
+ // The base extension url for the extension.
+ GURL extension_url_;
// A human-readable ID for the extension. The convention is to use something
// like 'com.example.myextension', but this is not currently enforced. An
@@ -104,41 +122,6 @@
// is expected to not change across versions. In the case of conflicts,
// updates will only be allowed if the extension can be validated using the
// previous version's update key.
- const std::string& id() const { return id_; }
-
- // The version number for the extension.
- const Version* version() const { return version_.get(); }
-
- // String representation of the version number.
- const std::string VersionString() const;
-
- // A human-readable name of the extension.
- const std::string& name() const { return name_; }
-
- // An optional longer description of the extension.
- const std::string& description() const { return description_; }
-
- // Paths to the content scripts that the extension contains.
- const UserScriptList& content_scripts() const {
- return content_scripts_;
- }
-
- // Path to the directory of NPAPI plugins that the extension contains.
- const FilePath& plugins_dir() const {
- return plugins_dir_;
- }
-
- // Initialize the extension from a parsed manifest.
- bool InitFromValue(const DictionaryValue& value, std::string* error);
-
- private:
- // The path to the directory the extension is stored in.
- FilePath path_;
-
- // The base extension url for the extension.
- GURL extension_url_;
-
- // The extension's ID.
std::string id_;
// The extension's version.
@@ -147,15 +130,19 @@
// The extension's human-readable name.
std::string name_;
- // An optional description for the extension.
+ // An optional longer description of the extension.
std::string description_;
// Paths to the content scripts the extension contains.
UserScriptList content_scripts_;
- // Path to the directory of NPAPI plugins that the extension contains.
+ // Optional absolute path to the directory of NPAPI plugins that the extension
+ // contains.
FilePath plugins_dir_;
+ // Optional URL of an HTML file to be displayed in the toolbar.
+ GURL toolstrip_url_;
+
// A SHA1 hash of the contents of the zip file. Note that this key is only
// present in the manifest that's prepended to the zip. The inner manifest
// will not have this key.