Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: ui/views/widget/native_widget_gtk.cc

Issue 8618001: Get rid of the EnableClose() infrastructure in Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/native_widget_gtk.h ('k') | ui/views/widget/native_widget_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/native_widget_gtk.h" 5 #include "ui/views/widget/native_widget_gtk.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/extensions/shape.h> 9 #include <X11/extensions/shape.h>
10 #include <gdk/gdk.h> 10 #include <gdk/gdk.h>
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 close_widget_factory_.GetWeakPtr())); 1173 close_widget_factory_.GetWeakPtr()));
1174 } 1174 }
1175 } 1175 }
1176 1176
1177 void NativeWidgetGtk::CloseNow() { 1177 void NativeWidgetGtk::CloseNow() {
1178 if (widget_) { 1178 if (widget_) {
1179 gtk_widget_destroy(widget_); // Triggers OnDestroy(). 1179 gtk_widget_destroy(widget_); // Triggers OnDestroy().
1180 } 1180 }
1181 } 1181 }
1182 1182
1183 void NativeWidgetGtk::EnableClose(bool enable) {
1184 gtk_window_set_deletable(GetNativeWindow(), enable);
1185 }
1186
1187 void NativeWidgetGtk::Show() { 1183 void NativeWidgetGtk::Show() {
1188 if (widget_) { 1184 if (widget_) {
1189 gtk_widget_show(widget_); 1185 gtk_widget_show(widget_);
1190 if (widget_->window) 1186 if (widget_->window)
1191 gdk_window_raise(widget_->window); 1187 gdk_window_raise(widget_->window);
1192 } 1188 }
1193 } 1189 }
1194 1190
1195 void NativeWidgetGtk::Hide() { 1191 void NativeWidgetGtk::Hide() {
1196 if (widget_) { 1192 if (widget_) {
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2303 button_pressed = event->type == GDK_BUTTON_PRESS || 2299 button_pressed = event->type == GDK_BUTTON_PRESS ||
2304 event->type == GDK_2BUTTON_PRESS || 2300 event->type == GDK_2BUTTON_PRESS ||
2305 event->type == GDK_3BUTTON_PRESS; 2301 event->type == GDK_3BUTTON_PRESS;
2306 gdk_event_free(event); 2302 gdk_event_free(event);
2307 } 2303 }
2308 return button_pressed; 2304 return button_pressed;
2309 } 2305 }
2310 2306
2311 } // namespace internal 2307 } // namespace internal
2312 } // namespace views 2308 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_gtk.h ('k') | ui/views/widget/native_widget_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698