diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 17:38:26 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 17:38:26 +0000 |
commit | c22198534b75e5576b1ab7a5d3b00db48e057caf (patch) | |
tree | f1bd3aa45d92d4b490780bb063fbe35b417392c6 /chrome/browser/gtk | |
parent | 5d1c2aa14ddacea07ca8dbf27c7d14055fdfb8e4 (diff) | |
download | chromium_src-c22198534b75e5576b1ab7a5d3b00db48e057caf.zip chromium_src-c22198534b75e5576b1ab7a5d3b00db48e057caf.tar.gz chromium_src-c22198534b75e5576b1ab7a5d3b00db48e057caf.tar.bz2 |
Remove BrowserWindow::Init().
This belongs as a private method of BrowserView. Neither mac nor linux uses it.
Review URL: http://codereview.chromium.org/42298
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 92 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 1 |
2 files changed, 45 insertions, 48 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index e7aa460..24a03bf 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -107,57 +107,12 @@ gboolean OnKeyPress(GtkWindow* window, GdkEventKey* event, gpointer userdata) { } // namespace +// TODO(estade): Break up this constructor into helper functions to improve +// readability. BrowserWindowGtk::BrowserWindowGtk(Browser* browser) : browser_(browser), // TODO(port): make this a pref. custom_frame_(false) { - Init(); - browser_->tabstrip_model()->AddObserver(this); -} - -BrowserWindowGtk::~BrowserWindowGtk() { - browser_->tabstrip_model()->RemoveObserver(this); - - Close(); -} - -gboolean BrowserWindowGtk::OnContentAreaExpose(GtkWidget* widget, - GdkEventExpose* e, - BrowserWindowGtk* window) { - if (window->custom_frame_) { - NOTIMPLEMENTED() << " needs custom drawing for the custom frame."; - return FALSE; - } - - // The theme graphics include the 2px frame, but we don't draw the frame - // in the non-custom-frame mode. So we subtract it off. - const int kFramePixels = 2; - - GdkPixbuf* pixbuf = - gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, // alpha - 8, // bit depth - widget->allocation.width, - BrowserToolbarGtk::kToolbarHeight + kFramePixels); - -#ifndef NDEBUG - // Fill with a bright color so we can see any pixels we're missing. - gdk_pixbuf_fill(pixbuf, 0x00FFFFFF); -#endif - - window->content_area_ninebox_->RenderTopCenterStrip(pixbuf, 0, - widget->allocation.width); - gdk_draw_pixbuf(widget->window, NULL, pixbuf, - 0, 0, - widget->allocation.x, - widget->allocation.y - kFramePixels, - -1, -1, - GDK_RGB_DITHER_NORMAL, 0, 0); - gdk_pixbuf_unref(pixbuf); - - return FALSE; // Allow subwidgets to paint. -} - -void BrowserWindowGtk::Init() { window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); gtk_window_set_default_size(window_, 640, 480); g_signal_connect(window_, "destroy", @@ -214,6 +169,49 @@ void BrowserWindowGtk::Init() { gtk_container_add(GTK_CONTAINER(window_), vbox_); gtk_widget_show(vbox_); + browser_->tabstrip_model()->AddObserver(this); +} + +BrowserWindowGtk::~BrowserWindowGtk() { + browser_->tabstrip_model()->RemoveObserver(this); + + Close(); +} + +gboolean BrowserWindowGtk::OnContentAreaExpose(GtkWidget* widget, + GdkEventExpose* e, + BrowserWindowGtk* window) { + if (window->custom_frame_) { + NOTIMPLEMENTED() << " needs custom drawing for the custom frame."; + return FALSE; + } + + // The theme graphics include the 2px frame, but we don't draw the frame + // in the non-custom-frame mode. So we subtract it off. + const int kFramePixels = 2; + + GdkPixbuf* pixbuf = + gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, // alpha + 8, // bit depth + widget->allocation.width, + BrowserToolbarGtk::kToolbarHeight + kFramePixels); + +#ifndef NDEBUG + // Fill with a bright color so we can see any pixels we're missing. + gdk_pixbuf_fill(pixbuf, 0x00FFFFFF); +#endif + + window->content_area_ninebox_->RenderTopCenterStrip(pixbuf, 0, + widget->allocation.width); + gdk_draw_pixbuf(widget->window, NULL, pixbuf, + 0, 0, + widget->allocation.x, + widget->allocation.y - kFramePixels, + -1, -1, + GDK_RGB_DITHER_NORMAL, 0, 0); + gdk_pixbuf_unref(pixbuf); + + return FALSE; // Allow subwidgets to paint. } void BrowserWindowGtk::Show() { diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 89eaa6e..24f7449 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -30,7 +30,6 @@ class BrowserWindowGtk : public BrowserWindow, virtual ~BrowserWindowGtk(); // Overridden from BrowserWindow - virtual void Init(); virtual void Show(); virtual void SetBounds(const gfx::Rect& bounds); virtual void Close(); |