| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ | 6 #define CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include "ui/gfx/rect.h" |
| 9 | 10 |
| 10 namespace content { | 11 namespace content { |
| 11 class WebContents; | 12 class WebContents; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace gtk_window_util { | 15 namespace gtk_window_util { |
| 15 | 16 |
| 16 // Performs Cut/Copy/Paste operation on the |window|'s |web_contents|. | 17 // Performs Cut/Copy/Paste operation on the |window|'s |web_contents|. |
| 17 void DoCut(GtkWindow* window, content::WebContents* web_contents); | 18 void DoCut(GtkWindow* window, content::WebContents* web_contents); |
| 18 void DoCopy(GtkWindow* window, content::WebContents* web_contents); | 19 void DoCopy(GtkWindow* window, content::WebContents* web_contents); |
| 19 void DoPaste(GtkWindow* window, content::WebContents* web_contents); | 20 void DoPaste(GtkWindow* window, content::WebContents* web_contents); |
| 20 | 21 |
| 21 // Ubuntu patches their version of GTK+ to that there is always a | 22 // Ubuntu patches their version of GTK+ to that there is always a |
| 22 // gripper in the bottom right corner of the window. We always need to | 23 // gripper in the bottom right corner of the window. We always need to |
| 23 // disable this feature since we can't communicate this to WebKit easily. | 24 // disable this feature since we can't communicate this to WebKit easily. |
| 24 void DisableResizeGrip(GtkWindow* window); | 25 void DisableResizeGrip(GtkWindow* window); |
| 25 | 26 |
| 26 // Returns the resize cursor corresponding to the window |edge|. | 27 // Returns the resize cursor corresponding to the window |edge|. |
| 27 GdkCursorType GdkWindowEdgeToGdkCursorType(GdkWindowEdge edge); | 28 GdkCursorType GdkWindowEdgeToGdkCursorType(GdkWindowEdge edge); |
| 28 | 29 |
| 30 // Returns |true| if the window bounds match the monitor size. |
| 31 bool BoundsMatchMonitorSize(GtkWindow* window, gfx::Rect bounds); |
| 32 |
| 33 bool HandleTitleBarLeftMousePress(GtkWindow* window, |
| 34 const gfx::Rect& bounds, |
| 35 GdkEventButton* event); |
| 36 |
| 37 // Request the underlying window to unmaximize. Also tries to work around |
| 38 // a window manager "feature" that can prevent this in some edge cases. |
| 39 void UnMaximize(GtkWindow* window, |
| 40 const gfx::Rect& bounds, |
| 41 const gfx::Rect& restored_bounds); |
| 42 |
| 29 } // namespace gtk_window_util | 43 } // namespace gtk_window_util |
| 30 | 44 |
| 31 #endif // CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ | 45 #endif // CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ |
| 32 | 46 |
| OLD | NEW |