From 84d33e6b9a3a5369859efc1365b275049a80c6ab Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Tue, 29 Sep 2009 00:03:50 +0000 Subject: Directly add ExtensionShelfGtk to the widget hierarchy. Just code cleanup. There's some more of this for the ExtensionShelfGtk::Toolstrip (adding removing the widgets from the hbox), but I kept that since the abstraction seems kind of useful. Review URL: http://codereview.chromium.org/242044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27438 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/browser_window_gtk.cc | 3 ++- chrome/browser/gtk/extension_shelf_gtk.cc | 4 ---- chrome/browser/gtk/extension_shelf_gtk.h | 7 ++++--- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'chrome/browser/gtk') diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index cdcf562..176eb98 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1640,7 +1640,8 @@ void BrowserWindowGtk::InitWidgets() { if (IsExtensionShelfSupported()) { extension_shelf_.reset(new ExtensionShelfGtk(browser()->profile(), browser_.get())); - extension_shelf_->AddShelfToBox(window_vbox_); + gtk_box_pack_end(GTK_BOX(window_vbox_), extension_shelf_->widget(), + FALSE, FALSE, 0); } // This vbox surrounds the render area: find bar, info bars and render view. diff --git a/chrome/browser/gtk/extension_shelf_gtk.cc b/chrome/browser/gtk/extension_shelf_gtk.cc index d0d7916..24547ed 100644 --- a/chrome/browser/gtk/extension_shelf_gtk.cc +++ b/chrome/browser/gtk/extension_shelf_gtk.cc @@ -81,10 +81,6 @@ ExtensionShelfGtk::~ExtensionShelfGtk() { event_box_.Destroy(); } -void ExtensionShelfGtk::AddShelfToBox(GtkWidget* box) { - gtk_box_pack_end(GTK_BOX(box), event_box_.get(), FALSE, FALSE, 0); -} - void ExtensionShelfGtk::Show() { gtk_widget_show_all(event_box_.get()); } diff --git a/chrome/browser/gtk/extension_shelf_gtk.h b/chrome/browser/gtk/extension_shelf_gtk.h index 4c124ebed..b5ea977 100644 --- a/chrome/browser/gtk/extension_shelf_gtk.h +++ b/chrome/browser/gtk/extension_shelf_gtk.h @@ -27,9 +27,6 @@ class ExtensionShelfGtk : public ExtensionShelfModelObserver, ExtensionShelfGtk(Profile* profile, Browser* browser); virtual ~ExtensionShelfGtk(); - // Adds this GTK shelf into a sizing box. - void AddShelfToBox(GtkWidget* box); - // Change the visibility of the bookmarks bar. (Starts out hidden, per GTK's // default behaviour). void Show(); @@ -51,6 +48,10 @@ class ExtensionShelfGtk : public ExtensionShelfModelObserver, const NotificationSource& source, const NotificationDetails& details); + GtkWidget* widget() { + return event_box_.get(); + } + private: class Toolstrip; -- cgit v1.1