summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/extension_shelf_gtk.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 00:12:10 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 00:12:10 +0000
commit9911cef2305b438052a2bec494f86847e3a8b01e (patch)
tree8ebe947dff47f340efe852486449a286c6b45543 /chrome/browser/gtk/extension_shelf_gtk.h
parent6c0006dce2f377730a9ee461eb20d6e00e88c3a6 (diff)
downloadchromium_src-9911cef2305b438052a2bec494f86847e3a8b01e.zip
chromium_src-9911cef2305b438052a2bec494f86847e3a8b01e.tar.gz
chromium_src-9911cef2305b438052a2bec494f86847e3a8b01e.tar.bz2
Populate the Linux extension shelf with placeholder labels containing each extension's name.
TEST=none http://crbug.com/16759 Review URL: http://codereview.chromium.org/155957 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/extension_shelf_gtk.h')
-rw-r--r--chrome/browser/gtk/extension_shelf_gtk.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/chrome/browser/gtk/extension_shelf_gtk.h b/chrome/browser/gtk/extension_shelf_gtk.h
index 849bc90..da2948d 100644
--- a/chrome/browser/gtk/extension_shelf_gtk.h
+++ b/chrome/browser/gtk/extension_shelf_gtk.h
@@ -7,6 +7,8 @@
#include <gtk/gtk.h>
+#include <set>
+
#include "base/scoped_ptr.h"
#include "chrome/browser/extensions/extension_shelf_model.h"
#include "chrome/common/notification_observer.h"
@@ -35,16 +37,18 @@ class ExtensionShelfGtk : public ExtensionShelfModelObserver,
void Hide();
// ExtensionShelfModelObserver
- virtual void ToolstripInsertedAt(ExtensionHost* toolstrip, int index);
- virtual void ToolstripRemovingAt(ExtensionHost* toolstrip, int index);
- virtual void ToolstripMoved(ExtensionHost* toolstrip,
+ virtual void ToolstripInsertedAt(ExtensionHost* host, int index);
+ virtual void ToolstripRemovingAt(ExtensionHost* host, int index);
+ virtual void ToolstripMoved(ExtensionHost* host,
int from_index,
int to_index);
- virtual void ToolstripChangedAt(ExtensionHost* toolstrip, int index);
+ virtual void ToolstripChangedAt(ExtensionHost* host, int index);
virtual void ExtensionShelfEmpty();
virtual void ShelfModelReloaded();
private:
+ class Toolstrip;
+
// Create the contents of the extension shelf.
void Init(Profile* profile);
@@ -59,6 +63,10 @@ class ExtensionShelfGtk : public ExtensionShelfModelObserver,
// Determines what is our target height and sets it.
void AdjustHeight();
+ void LoadFromModel();
+
+ Toolstrip* ToolstripAtIndex(int index);
+
// GtkHBox callbacks.
static gboolean OnHBoxExpose(GtkWidget* widget, GdkEventExpose* event,
ExtensionShelfGtk* window);
@@ -72,10 +80,6 @@ class ExtensionShelfGtk : public ExtensionShelfModelObserver,
// Used to position all children.
GtkWidget* shelf_hbox_;
- // Label for placeholder text.
- // TODO(phajdan.jr): Remove the placeholder label when we have real contents.
- GtkWidget* label_;
-
GtkThemeProvider* theme_provider_;
// Paints the background for our bookmark bar.
@@ -85,6 +89,11 @@ class ExtensionShelfGtk : public ExtensionShelfModelObserver,
// The model representing the toolstrips on the shelf.
scoped_ptr<ExtensionShelfModel> model_;
+
+ // Set of toolstrip views which are really on the shelf.
+ std::set<Toolstrip*> toolstrips_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionShelfGtk);
};
#endif // CHROME_BROWSER_EXTENSION_SHELF_GTK_H_