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

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

Issue 39285: Support loading extensions into the bookmark toolbar. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « no previous file | chrome/browser/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension.h
===================================================================
--- chrome/browser/extensions/extension.h (revision 11270)
+++ chrome/browser/extensions/extension.h (working copy)
@@ -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,53 +97,31 @@
// 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_; }
-
- // A human-readable ID for the extension. The convention is to use something
- // like 'com.example.myextension', but this is not currently enforced. An
- // extension's ID is used in things like directory structures and URLs, and
- // 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_; }
+ const UserScriptList& content_scripts() const { return content_scripts_; }
+ const FilePath& plugins_dir() const { return plugins_dir_; }
+ const GURL& toolstrip_url() const { return toolstrip_url_; }
- // 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.
+ // The absolute 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.
+ // A human-readable ID for the extension. The convention is to use something
+ // like 'com.example.myextension', but this is not currently enforced. An
+ // extension's ID is used in things like directory structures and URLs, and
+ // 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.
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.
« no previous file with comments | « no previous file | chrome/browser/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698