| 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 #include "ui/gfx/rect.h" |
| 10 | 10 |
| 11 class BaseWindow; |
| 12 |
| 11 namespace content { | 13 namespace content { |
| 12 class WebContents; | 14 class WebContents; |
| 13 } | 15 } |
| 14 | 16 |
| 15 namespace gtk_window_util { | 17 namespace gtk_window_util { |
| 16 | 18 |
| 17 // Performs Cut/Copy/Paste operation on the |window|'s |web_contents|. | 19 // Performs Cut/Copy/Paste operation on the |window|'s |web_contents|. |
| 18 void DoCut(GtkWindow* window, content::WebContents* web_contents); | 20 void DoCut(GtkWindow* window, content::WebContents* web_contents); |
| 19 void DoCopy(GtkWindow* window, content::WebContents* web_contents); | 21 void DoCopy(GtkWindow* window, content::WebContents* web_contents); |
| 20 void DoPaste(GtkWindow* window, content::WebContents* web_contents); | 22 void DoPaste(GtkWindow* window, content::WebContents* web_contents); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 GdkEventButton* event); | 37 GdkEventButton* event); |
| 36 | 38 |
| 37 // Request the underlying window to unmaximize. Also tries to work around | 39 // Request the underlying window to unmaximize. Also tries to work around |
| 38 // a window manager "feature" that can prevent this in some edge cases. | 40 // a window manager "feature" that can prevent this in some edge cases. |
| 39 void UnMaximize(GtkWindow* window, | 41 void UnMaximize(GtkWindow* window, |
| 40 const gfx::Rect& bounds, | 42 const gfx::Rect& bounds, |
| 41 const gfx::Rect& restored_bounds); | 43 const gfx::Rect& restored_bounds); |
| 42 | 44 |
| 43 // Set a custom WM_CLASS for a window. | 45 // Set a custom WM_CLASS for a window. |
| 44 void SetWindowCustomClass(GtkWindow* window, const std::string& wmclass); | 46 void SetWindowCustomClass(GtkWindow* window, const std::string& wmclass); |
| 47 |
| 48 // Update the origin of |bounds| and |restored_bounds| with values gotten |
| 49 // from GTK. |
| 50 void UpdateWindowPosition(BaseWindow* window, |
| 51 gfx::Rect* bounds, |
| 52 gfx::Rect* restored_bounds); |
| 45 } // namespace gtk_window_util | 53 } // namespace gtk_window_util |
| 46 | 54 |
| 47 #endif // CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ | 55 #endif // CHROME_BROWSER_UI_GTK_GTK_WINDOW_UTIL_H_ |
| 48 | 56 |
| OLD | NEW |