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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 } | 1147 } |
1148 | 1148 |
1149 void NativeWidgetGtk::Hide() { | 1149 void NativeWidgetGtk::Hide() { |
1150 if (widget_) { | 1150 if (widget_) { |
1151 gtk_widget_hide(widget_); | 1151 gtk_widget_hide(widget_); |
1152 if (widget_->window) | 1152 if (widget_->window) |
1153 gdk_window_lower(widget_->window); | 1153 gdk_window_lower(widget_->window); |
1154 } | 1154 } |
1155 } | 1155 } |
1156 | 1156 |
| 1157 void NativeWidgetGtk::ShowMaximized(const gfx::Rect& restored_bounds) { |
| 1158 // TODO: when we add maximization support update this. |
| 1159 Show(); |
| 1160 } |
| 1161 |
1157 void NativeWidgetGtk::ShowNativeWidget(ShowState state) { | 1162 void NativeWidgetGtk::ShowNativeWidget(ShowState state) { |
1158 // No concept of maximization (yet) on ChromeOS. | 1163 // No concept of maximization (yet) on ChromeOS. |
1159 if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE) | 1164 if (state == internal::NativeWidgetPrivate::SHOW_INACTIVE) |
1160 gtk_window_set_focus_on_map(GetNativeWindow(), false); | 1165 gtk_window_set_focus_on_map(GetNativeWindow(), false); |
1161 gtk_widget_show(GetNativeView()); | 1166 gtk_widget_show(GetNativeView()); |
1162 } | 1167 } |
1163 | 1168 |
1164 bool NativeWidgetGtk::IsVisible() const { | 1169 bool NativeWidgetGtk::IsVisible() const { |
1165 return GTK_WIDGET_VISIBLE(GetNativeView()); | 1170 return GTK_WIDGET_VISIBLE(GetNativeView()); |
1166 } | 1171 } |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 button_pressed = event->type == GDK_BUTTON_PRESS || | 2166 button_pressed = event->type == GDK_BUTTON_PRESS || |
2162 event->type == GDK_2BUTTON_PRESS || | 2167 event->type == GDK_2BUTTON_PRESS || |
2163 event->type == GDK_3BUTTON_PRESS; | 2168 event->type == GDK_3BUTTON_PRESS; |
2164 gdk_event_free(event); | 2169 gdk_event_free(event); |
2165 } | 2170 } |
2166 return button_pressed; | 2171 return button_pressed; |
2167 } | 2172 } |
2168 | 2173 |
2169 } // namespace internal | 2174 } // namespace internal |
2170 } // namespace views | 2175 } // namespace views |
OLD | NEW |