| Index: chrome/browser/ui/gtk/browser_window_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
|
| index 4d70f6a69c4cea6e480763d56269675c942d06e6..ad5ac070ce28ad5777e35dfab789ae1b809ed250 100644
|
| --- a/chrome/browser/ui/gtk/browser_window_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
|
| @@ -4,7 +4,6 @@
|
|
|
| #include "chrome/browser/ui/gtk/browser_window_gtk.h"
|
|
|
| -#include <dlfcn.h>
|
| #include <gdk/gdkkeysyms.h>
|
|
|
| #include <algorithm>
|
| @@ -152,24 +151,6 @@ const int kCustomFrameBackgroundVerticalOffset = 15;
|
| // gtk_window_get_position() after the last GTK configure-event signal.
|
| const int kDebounceTimeoutMilliseconds = 100;
|
|
|
| -// Ubuntu patches their verrsion of GTK+ so that there is always a
|
| -// gripper in the bottom right corner of the window. We dynamically
|
| -// look up this symbol because it's a non-standard Ubuntu extension to
|
| -// GTK+. We always need to disable this feature since we can't
|
| -// communicate this to WebKit easily.
|
| -typedef void (*gtk_window_set_has_resize_grip_func)(GtkWindow*, gboolean);
|
| -gtk_window_set_has_resize_grip_func gtk_window_set_has_resize_grip_sym;
|
| -
|
| -void EnsureResizeGripFunction() {
|
| - static bool resize_grip_looked_up = false;
|
| - if (!resize_grip_looked_up) {
|
| - resize_grip_looked_up = true;
|
| - gtk_window_set_has_resize_grip_sym =
|
| - reinterpret_cast<gtk_window_set_has_resize_grip_func>(
|
| - dlsym(NULL, "gtk_window_set_has_resize_grip"));
|
| - }
|
| -}
|
| -
|
| // Using gtk_window_get_position/size creates a race condition, so only use
|
| // this to get the initial bounds. After window creation, we pick up the
|
| // normal bounds by connecting to the configure-event signal.
|
| @@ -236,30 +217,6 @@ int GetPreHandleCommandId(GdkEventKey* event) {
|
| return -1;
|
| }
|
|
|
| -GdkCursorType GdkWindowEdgeToGdkCursorType(GdkWindowEdge edge) {
|
| - switch (edge) {
|
| - case GDK_WINDOW_EDGE_NORTH_WEST:
|
| - return GDK_TOP_LEFT_CORNER;
|
| - case GDK_WINDOW_EDGE_NORTH:
|
| - return GDK_TOP_SIDE;
|
| - case GDK_WINDOW_EDGE_NORTH_EAST:
|
| - return GDK_TOP_RIGHT_CORNER;
|
| - case GDK_WINDOW_EDGE_WEST:
|
| - return GDK_LEFT_SIDE;
|
| - case GDK_WINDOW_EDGE_EAST:
|
| - return GDK_RIGHT_SIDE;
|
| - case GDK_WINDOW_EDGE_SOUTH_WEST:
|
| - return GDK_BOTTOM_LEFT_CORNER;
|
| - case GDK_WINDOW_EDGE_SOUTH:
|
| - return GDK_BOTTOM_SIDE;
|
| - case GDK_WINDOW_EDGE_SOUTH_EAST:
|
| - return GDK_BOTTOM_RIGHT_CORNER;
|
| - default:
|
| - NOTREACHED();
|
| - }
|
| - return GDK_LAST_CURSOR;
|
| -}
|
| -
|
| // A helper method for setting the GtkWindow size that should be used in place
|
| // of calling gtk_window_resize directly. This is done to avoid a WM "feature"
|
| // where setting the window size to the monitor size causes the WM to set the
|
| @@ -381,9 +338,7 @@ void BrowserWindowGtk::Init() {
|
| GDK_POINTER_MOTION_MASK);
|
|
|
| // Disable the resize gripper on Ubuntu.
|
| - EnsureResizeGripFunction();
|
| - if (gtk_window_set_has_resize_grip_sym)
|
| - gtk_window_set_has_resize_grip_sym(GTK_WINDOW(window_), FALSE);
|
| + gtk_util::DisableResizeGrip(window_);
|
|
|
| // Add this window to its own unique window group to allow for
|
| // window-to-parent modality.
|
| @@ -1226,15 +1181,15 @@ void BrowserWindowGtk::ShowCreateChromeAppShortcutsDialog(
|
| }
|
|
|
| void BrowserWindowGtk::Cut() {
|
| - gtk_util::DoCut(this);
|
| + gtk_util::DoCut(window_, chrome::GetActiveWebContents(browser_.get()));
|
| }
|
|
|
| void BrowserWindowGtk::Copy() {
|
| - gtk_util::DoCopy(this);
|
| + gtk_util::DoCopy(window_, chrome::GetActiveWebContents(browser_.get()));
|
| }
|
|
|
| void BrowserWindowGtk::Paste() {
|
| - gtk_util::DoPaste(this);
|
| + gtk_util::DoPaste(window_, chrome::GetActiveWebContents(browser_.get()));
|
| }
|
|
|
| void BrowserWindowGtk::ShowInstant(TabContents* preview) {
|
| @@ -2258,7 +2213,7 @@ gboolean BrowserWindowGtk::OnMouseMoveEvent(GtkWidget* widget,
|
| static_cast<int>(event->y), &edge);
|
| GdkCursorType new_cursor = GDK_LAST_CURSOR;
|
| if (has_hit_edge)
|
| - new_cursor = GdkWindowEdgeToGdkCursorType(edge);
|
| + new_cursor = gtk_util::GdkWindowEdgeToGdkCursorType(edge);
|
|
|
| GdkCursorType last_cursor = GDK_LAST_CURSOR;
|
| if (frame_cursor_)
|
|
|