diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-26 00:11:42 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-26 00:11:42 +0000 |
commit | bbc94554729407f821d4a60828c5758a112f042a (patch) | |
tree | fa92103aa16e6ff04e90206c6ac99710c3c2d7ca /chrome/browser/extensions/extension_shelf_model.h | |
parent | 4289d9b66a1453aad1115f6ede0007faab22d6d4 (diff) | |
download | chromium_src-bbc94554729407f821d4a60828c5758a112f042a.zip chromium_src-bbc94554729407f821d4a60828c5758a112f042a.tar.gz chromium_src-bbc94554729407f821d4a60828c5758a112f042a.tar.bz2 |
add mole info to toolstrip definition and enable moles
Review URL: http://codereview.chromium.org/159202
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_shelf_model.h')
-rw-r--r-- | chrome/browser/extensions/extension_shelf_model.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_shelf_model.h b/chrome/browser/extensions/extension_shelf_model.h index ab2af06..28fb00b 100644 --- a/chrome/browser/extensions/extension_shelf_model.h +++ b/chrome/browser/extensions/extension_shelf_model.h @@ -56,6 +56,12 @@ class ExtensionShelfModel : public NotificationObserver { ExtensionShelfModel(Browser* browser); virtual ~ExtensionShelfModel(); + struct ToolstripItem { + ExtensionHost* host; + Extension::ToolstripInfo info; + void* data; + }; + // Add and remove observers to changes within this ExtensionShelfModel. void AddObserver(ExtensionShelfModelObserver* observer); void RemoveObserver(ExtensionShelfModelObserver* observer); @@ -65,10 +71,10 @@ class ExtensionShelfModel : public NotificationObserver { bool empty() const { return toolstrips_.empty(); } // Add |toolstrip| to the end of the shelf. - void AppendToolstrip(ExtensionHost* toolstrip); + void AppendToolstrip(const ToolstripItem& toolstrip); // Insert |toolstrip| and |data| at |index|. - void InsertToolstripAt(int index, ExtensionHost* toolstrip, void* data); + void InsertToolstripAt(int index, const ToolstripItem& toolstrip); // Remove the toolstrip at |index|. void RemoveToolstripAt(int index); @@ -79,9 +85,12 @@ class ExtensionShelfModel : public NotificationObserver { // Lookup the index of |toolstrip|. Returns -1 if not present. int IndexOfToolstrip(ExtensionHost* toolstrip); - // Return the toolstrip at |index|. Returns NULL if index is out of range. + // Return the toolstrip at |index|. ExtensionHost* ToolstripAt(int index); + // Return the ToolstripInfo at |index|. + Extension::ToolstripInfo& ToolstripInfoAt(int index); + // Get/Set some arbitrary data associated with a particular toolstrip. void SetToolstripDataAt(int index, void* data); void* ToolstripDataAt(int index); @@ -117,7 +126,6 @@ class ExtensionShelfModel : public NotificationObserver { NotificationRegistrar registrar_; // The Toolstrips loaded in this model. The model owns these objects. - typedef std::pair<ExtensionHost*, void*> ToolstripItem; typedef std::vector<ToolstripItem> ExtensionToolstrips; ExtensionToolstrips toolstrips_; |