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

Unified Diff: views/widget/native_widget_gtk.cc

Issue 6976040: Revert 86914 - Move a bunch of functions from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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_views.h » ('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 86938)
+++ views/widget/native_widget_gtk.cc (working copy)
@@ -284,7 +284,6 @@
NativeWidgetGtk::NativeWidgetGtk(internal::NativeWidgetDelegate* delegate)
: is_window_(false),
- window_state_(GDK_WINDOW_STATE_WITHDRAWN),
delegate_(delegate),
widget_(NULL),
window_contents_(NULL),
@@ -717,8 +716,6 @@
G_CALLBACK(&OnDragEndThunk), this);
g_signal_connect(window_contents_, "drag_failed",
G_CALLBACK(&OnDragFailedThunk), this);
- g_signal_connect(G_OBJECT(GetNativeWindow()), "window-state-event",
- G_CALLBACK(&OnWindowStateEventThunk), this);
tooltip_manager_.reset(new TooltipManagerGtk(this));
@@ -960,23 +957,15 @@
}
}
-bool NativeWidgetGtk::IsVisible() const {
- return GTK_WIDGET_VISIBLE(GetNativeView());
+void NativeWidgetGtk::SetOpacity(unsigned char opacity) {
+ opacity_ = opacity;
+ if (widget_) {
+ // We can only set the opacity when the widget has been realized.
+ gdk_window_set_opacity(widget_->window, static_cast<gdouble>(opacity) /
+ static_cast<gdouble>(255));
+ }
}
-void NativeWidgetGtk::Activate() {
- gtk_window_present(GetNativeWindow());
-}
-
-void NativeWidgetGtk::Deactivate() {
- gdk_window_lower(GTK_WIDGET(GetNativeView())->window);
-}
-
-bool NativeWidgetGtk::IsActive() const {
- DCHECK(!child_);
- return is_active_;
-}
-
void NativeWidgetGtk::SetAlwaysOnTop(bool on_top) {
DCHECK(!child_);
always_on_top_ = on_top;
@@ -984,38 +973,15 @@
gtk_window_set_keep_above(GTK_WINDOW(widget_), on_top);
}
-void NativeWidgetGtk::Maximize() {
- gtk_window_maximize(GetNativeWindow());
+bool NativeWidgetGtk::IsVisible() const {
+ return GTK_WIDGET_VISIBLE(widget_);
}
-void NativeWidgetGtk::Minimize() {
- gtk_window_iconify(GetNativeWindow());
+bool NativeWidgetGtk::IsActive() const {
+ DCHECK(!child_);
+ return is_active_;
}
-bool NativeWidgetGtk::IsMaximized() const {
- return window_state_ & GDK_WINDOW_STATE_MAXIMIZED;
-}
-
-bool NativeWidgetGtk::IsMinimized() const {
- return window_state_ & GDK_WINDOW_STATE_ICONIFIED;
-}
-
-void NativeWidgetGtk::Restore() {
- if (IsMaximized())
- gtk_window_unmaximize(GetNativeWindow());
- else if (IsMinimized())
- gtk_window_deiconify(GetNativeWindow());
-}
-
-void NativeWidgetGtk::SetOpacity(unsigned char opacity) {
- opacity_ = opacity;
- if (widget_) {
- // We can only set the opacity when the widget has been realized.
- gdk_window_set_opacity(widget_->window, static_cast<gdouble>(opacity) /
- static_cast<gdouble>(255));
- }
-}
-
bool NativeWidgetGtk::IsAccessibleWidget() const {
return false;
}
@@ -1395,12 +1361,6 @@
void NativeWidgetGtk::OnHide(GtkWidget* widget) {
}
-gboolean NativeWidgetGtk::OnWindowStateEvent(GtkWidget* widget,
- GdkEventWindowState* event) {
- window_state_ = event->new_window_state;
- return FALSE;
-}
-
void NativeWidgetGtk::HandleXGrabBroke() {
}
« no previous file with comments | « views/widget/native_widget_gtk.h ('k') | views/widget/native_widget_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698