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

Unified Diff: views/widget/native_widget_gtk.cc

Issue 7054052: Move more from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/native_widget_gtk.h ('k') | views/widget/native_widget_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « views/widget/native_widget_gtk.h ('k') | views/widget/native_widget_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698