summaryrefslogtreecommitdiffstats
path: root/views/window/window_gtk.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 20:56:11 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 20:56:11 +0000
commit893160d54cb5b2c1c68d3b69ec8ebc9b25b68b82 (patch)
tree0f29c1776a2f34f06ba60ba53a20691d261b6366 /views/window/window_gtk.cc
parent22332192088e1e897d02a4bc7a2983e3864ab3b6 (diff)
downloadchromium_src-893160d54cb5b2c1c68d3b69ec8ebc9b25b68b82.zip
chromium_src-893160d54cb5b2c1c68d3b69ec8ebc9b25b68b82.tar.gz
chromium_src-893160d54cb5b2c1c68d3b69ec8ebc9b25b68b82.tar.bz2
Minor gtk-views cleanup:
. Makes closing widget work. . Makes clicking button send action. . Fixes ownership of native controls. BUG=none TEST=none Review URL: http://codereview.chromium.org/113657 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window/window_gtk.cc')
-rw-r--r--views/window/window_gtk.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index 2a74706..087bf11 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -72,7 +72,16 @@ void WindowGtk::Activate() {
}
void WindowGtk::Close() {
- NOTIMPLEMENTED();
+ if (window_closed_) {
+ // Don't do anything if we've already been closed.
+ return;
+ }
+
+ if (non_client_view_->CanClose()) {
+ SaveWindowPosition();
+ WidgetGtk::Close();
+ window_closed_ = true;
+ }
}
void WindowGtk::Maximize() {
@@ -175,7 +184,8 @@ WindowGtk::WindowGtk(WindowDelegate* window_delegate)
: WidgetGtk(TYPE_WINDOW),
is_modal_(false),
window_delegate_(window_delegate),
- non_client_view_(new NonClientView(this)) {
+ non_client_view_(new NonClientView(this)),
+ window_closed_(false) {
is_window_ = true;
window_delegate_->window_.reset(this);
}
@@ -210,4 +220,12 @@ void WindowGtk::Init(const gfx::Rect& bounds) {
// ResetWindowRegion(false);
}
+void WindowGtk::SaveWindowPosition() {
+ // The delegate may have gone away on us.
+ if (!window_delegate_)
+ return;
+
+ NOTIMPLEMENTED();
+}
+
} // namespace views