| OLD | NEW |
| 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 "views/widget/native_widget_gtk.h" | 5 #include "views/widget/native_widget_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
| 9 #include <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
| 10 #include <X11/Xatom.h> | 10 #include <X11/Xatom.h> |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 | 1192 |
| 1193 void NativeWidgetGtk::Hide() { | 1193 void NativeWidgetGtk::Hide() { |
| 1194 if (widget_) { | 1194 if (widget_) { |
| 1195 gtk_widget_hide(widget_); | 1195 gtk_widget_hide(widget_); |
| 1196 if (widget_->window) | 1196 if (widget_->window) |
| 1197 gdk_window_lower(widget_->window); | 1197 gdk_window_lower(widget_->window); |
| 1198 delegate_->OnNativeWidgetVisibilityChanged(false); | 1198 delegate_->OnNativeWidgetVisibilityChanged(false); |
| 1199 } | 1199 } |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 void NativeWidgetGtk::ShowNativeWidget(ShowState state) { | 1202 void NativeWidgetGtk::ShowMaximizedWithBounds( |
| 1203 const gfx::Rect& restored_bounds) { |
| 1204 // TODO: when we add maximization support update this. |
| 1205 Show(); |
| 1206 } |
| 1207 |
| 1208 void NativeWidgetGtk::ShowWithState(ShowState state) { |
| 1203 // No concept of maximization (yet) on ChromeOS. | 1209 // No concept of maximization (yet) on ChromeOS. |
| 1204 if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE) | 1210 if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE) |
| 1205 gtk_window_set_focus_on_map(GetNativeWindow(), false); | 1211 gtk_window_set_focus_on_map(GetNativeWindow(), false); |
| 1206 gtk_widget_show(GetNativeView()); | 1212 gtk_widget_show(GetNativeView()); |
| 1207 } | 1213 } |
| 1208 | 1214 |
| 1209 bool NativeWidgetGtk::IsVisible() const { | 1215 bool NativeWidgetGtk::IsVisible() const { |
| 1210 return GTK_WIDGET_VISIBLE(GetNativeView()); | 1216 return GTK_WIDGET_VISIBLE(GetNativeView()); |
| 1211 } | 1217 } |
| 1212 | 1218 |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 button_pressed = event->type == GDK_BUTTON_PRESS || | 2233 button_pressed = event->type == GDK_BUTTON_PRESS || |
| 2228 event->type == GDK_2BUTTON_PRESS || | 2234 event->type == GDK_2BUTTON_PRESS || |
| 2229 event->type == GDK_3BUTTON_PRESS; | 2235 event->type == GDK_3BUTTON_PRESS; |
| 2230 gdk_event_free(event); | 2236 gdk_event_free(event); |
| 2231 } | 2237 } |
| 2232 return button_pressed; | 2238 return button_pressed; |
| 2233 } | 2239 } |
| 2234 | 2240 |
| 2235 } // namespace internal | 2241 } // namespace internal |
| 2236 } // namespace views | 2242 } // namespace views |
| OLD | NEW |