Chromium Code Reviews| Index: chrome/browser/extensions/extension_shelf_model.h |
| diff --git a/chrome/browser/extensions/extension_shelf_model.h b/chrome/browser/extensions/extension_shelf_model.h |
| index ab2af06000e56425a8e4fdd21786fffa8b6e21d6..954fa05725164cfc3fb990e657b5ab57d9640b3b 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); |
|
Matt Perry
2009/07/24 23:11:11
IndexOfExtension?
Erik does not do reviews
2009/07/26 00:34:46
No. An extension can have multiple toolstrips.
Matt Perry
2009/07/27 17:41:50
Then what good is this method?
Actually, after a
|
| - // 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_; |