| Index: views/widget/native_widget_gtk.cc
|
| ===================================================================
|
| --- views/widget/native_widget_gtk.cc (revision 88218)
|
| +++ views/widget/native_widget_gtk.cc (working copy)
|
| @@ -446,7 +446,7 @@
|
| }
|
|
|
| void NativeWidgetGtk::IsActiveChanged() {
|
| - GetWidget()->widget_delegate()->OnWidgetActivated(IsActive());
|
| + delegate_->OnNativeWidgetActivationChanged(IsActive());
|
| }
|
|
|
| void NativeWidgetGtk::SetInitialFocus() {
|
| @@ -920,6 +920,11 @@
|
| return gfx::Rect(x, y, w, h);
|
| }
|
|
|
| +gfx::Rect NativeWidgetGtk::GetRestoredBounds() const {
|
| + // We currently don't support tiling, so this doesn't matter.
|
| + return GetWindowScreenBounds();
|
| +}
|
| +
|
| void NativeWidgetGtk::SetBounds(const gfx::Rect& bounds) {
|
| if (child_) {
|
| GtkWidget* parent = gtk_widget_get_parent(widget_);
|
| @@ -1013,6 +1018,10 @@
|
| }
|
| }
|
|
|
| +void NativeWidgetGtk::EnableClose(bool enable) {
|
| + gtk_window_set_deletable(GetNativeWindow(), enable);
|
| +}
|
| +
|
| void NativeWidgetGtk::Show() {
|
| if (widget_) {
|
| gtk_widget_show(widget_);
|
| @@ -1029,6 +1038,13 @@
|
| }
|
| }
|
|
|
| +void NativeWidgetGtk::ShowNativeWidget(ShowState state) {
|
| + // No concept of maximization (yet) on ChromeOS.
|
| + if (state == NativeWidget::SHOW_INACTIVE)
|
| + gtk_window_set_focus_on_map(GetNativeWindow(), false);
|
| + gtk_widget_show(GetNativeView());
|
| +}
|
| +
|
| bool NativeWidgetGtk::IsVisible() const {
|
| return GTK_WIDGET_VISIBLE(GetNativeView());
|
| }
|
| @@ -1070,10 +1086,14 @@
|
| }
|
|
|
| void NativeWidgetGtk::Restore() {
|
| - if (IsMaximized())
|
| - gtk_window_unmaximize(GetNativeWindow());
|
| - else if (IsMinimized())
|
| - gtk_window_deiconify(GetNativeWindow());
|
| + if (IsFullscreen()) {
|
| + SetFullscreen(false);
|
| + } else {
|
| + if (IsMaximized())
|
| + gtk_window_unmaximize(GetNativeWindow());
|
| + else if (IsMinimized())
|
| + gtk_window_deiconify(GetNativeWindow());
|
| + }
|
| }
|
|
|
| void NativeWidgetGtk::SetFullscreen(bool fullscreen) {
|
| @@ -1167,7 +1187,7 @@
|
| if (new_size == size_)
|
| return;
|
| size_ = new_size;
|
| - delegate_->OnSizeChanged(size_);
|
| + delegate_->OnNativeWidgetSizeChanged(size_);
|
| }
|
|
|
| gboolean NativeWidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) {
|
| @@ -1447,6 +1467,7 @@
|
| }
|
|
|
| void NativeWidgetGtk::OnDestroy(GtkWidget* object) {
|
| + delegate_->OnNativeWidgetDestroying();
|
| if (!child_)
|
| ActiveWindowWatcherX::RemoveObserver(this);
|
| // Note that this handler is hooked to GtkObject::destroy.
|
|
|