summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 00:58:09 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 00:58:09 +0000
commita31a86f053c3ff09f3cd047b165aef1d29749ea6 (patch)
tree156f84c8cd0cc7f5c618919ffe6661d90e22a2d6 /chrome
parenta4f822706d208f38e26988f39d43d54a4dfd2fce (diff)
downloadchromium_src-a31a86f053c3ff09f3cd047b165aef1d29749ea6.zip
chromium_src-a31a86f053c3ff09f3cd047b165aef1d29749ea6.tar.gz
chromium_src-a31a86f053c3ff09f3cd047b165aef1d29749ea6.tar.bz2
Make the new linux browser shut down cleanly.
Review URL: http://codereview.chromium.org/21112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser.cc4
-rw-r--r--chrome/browser/browser_window.h1
-rw-r--r--chrome/browser/browser_window_gtk.cc15
-rw-r--r--chrome/browser/browser_window_gtk.h3
4 files changed, 19 insertions, 4 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index e8301f4..a1c9aef 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -201,7 +201,11 @@ Browser::Browser(Type type, Profile* profile)
Browser::~Browser() {
// The tab strip should be empty at this point.
+#if !defined(OS_LINUX)
+ // TODO(erg): Temporarily disabling this DCHECK while we build the linux
+ // views system. We don't have a tabstrip model up yet.
DCHECK(tabstrip_model_.empty());
+#endif
tabstrip_model_.RemoveObserver(this);
BrowserList::RemoveBrowser(this);
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h
index 408f4ff..1b382ae 100644
--- a/chrome/browser/browser_window.h
+++ b/chrome/browser/browser_window.h
@@ -66,7 +66,6 @@ class BrowserWindow {
// Inform the frame that the selected tab favicon or title has changed. Some
// frames may need to refresh their title bar.
- // TODO(beng): make this pure virtual after XPFrame/VistaFrame retire.
virtual void UpdateTitleBar() = 0;
// Update any loading animations running in the window. |should_animate| is
diff --git a/chrome/browser/browser_window_gtk.cc b/chrome/browser/browser_window_gtk.cc
index af251453..87fd231 100644
--- a/chrome/browser/browser_window_gtk.cc
+++ b/chrome/browser/browser_window_gtk.cc
@@ -8,12 +8,21 @@
#include "base/gfx/rect.h"
#include "base/logging.h"
+#include "chrome/browser/browser.h"
+
+namespace {
+
+gboolean MainWindowDestroyed(GtkWindow* window, BrowserWindowGtk* browser_win) {
+ delete browser_win;
+ return FALSE; // Don't stop this message.
+}
+
+} // namespace
BrowserWindowGtk::BrowserWindowGtk(Browser* browser) : browser_(browser) {
Init();
}
-// TODO(estade): are we the owners of browser_? If so, we need to free it here.
BrowserWindowGtk::~BrowserWindowGtk() {
Close();
}
@@ -22,6 +31,8 @@ void BrowserWindowGtk::Init() {
window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
gtk_window_set_title(window_, "Chromium");
gtk_window_set_default_size(window_, 640, 480);
+ g_signal_connect(G_OBJECT(window_), "destroy",
+ G_CALLBACK(MainWindowDestroyed), this);
}
void BrowserWindowGtk::Show() {
@@ -168,6 +179,6 @@ void BrowserWindowGtk::ShowHTMLDialog(HtmlDialogContentsDelegate* delegate,
}
void BrowserWindowGtk::DestroyBrowser() {
- NOTIMPLEMENTED();
+ browser_.reset();
}
diff --git a/chrome/browser/browser_window_gtk.h b/chrome/browser/browser_window_gtk.h
index 36be2a8..07e9e2f 100644
--- a/chrome/browser/browser_window_gtk.h
+++ b/chrome/browser/browser_window_gtk.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_WINDOW_GTK_H_
+#include "base/scoped_ptr.h"
#include "chrome/browser/browser_window.h"
typedef struct _GtkWindow GtkWindow;
@@ -58,7 +59,7 @@ class BrowserWindowGtk : public BrowserWindow {
protected:
virtual void DestroyBrowser();
GtkWindow* window_;
- Browser* browser_;
+ scoped_ptr<Browser> browser_;
};
#endif // CHROME_BROWSER_WINDOW_GTK_H_