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_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
6 #define CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 6 #define CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 class BrowserWindow; | 22 class BrowserWindow; |
23 class GtkThemeService; | 23 class GtkThemeService; |
24 class GURL; | 24 class GURL; |
25 class Profile; | 25 class Profile; |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 class Image; | 28 class Image; |
29 } | 29 } |
30 | 30 |
31 namespace content { | |
32 class WebContents; | |
33 } | |
34 | |
31 namespace gtk_util { | 35 namespace gtk_util { |
32 | 36 |
33 // Create a table of labeled controls, using proper spacing and alignment. | 37 // Create a table of labeled controls, using proper spacing and alignment. |
34 // Arguments should be pairs of const char*, GtkWidget*, concluding with a | 38 // Arguments should be pairs of const char*, GtkWidget*, concluding with a |
35 // NULL. The first argument is a vector in which to place all labels | 39 // NULL. The first argument is a vector in which to place all labels |
36 // produced. It can be NULL if you don't need to keep track of the label | 40 // produced. It can be NULL if you don't need to keep track of the label |
37 // widgets. The second argument is a color to force the label text to. It can | 41 // widgets. The second argument is a color to force the label text to. It can |
38 // be NULL to get the system default. | 42 // be NULL to get the system default. |
39 // | 43 // |
40 // For example: | 44 // For example: |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 // PANGO_ELLIPSIZE_END. | 305 // PANGO_ELLIPSIZE_END. |
302 // It must be done when the label is mapped (become visible on the screen), | 306 // It must be done when the label is mapped (become visible on the screen), |
303 // to make sure the pango can get correct font information for the calculation. | 307 // to make sure the pango can get correct font information for the calculation. |
304 void InitLabelSizeRequestAndEllipsizeMode(GtkWidget* label); | 308 void InitLabelSizeRequestAndEllipsizeMode(GtkWidget* label); |
305 | 309 |
306 // A helper function for gtk_message_dialog_new() to work around a few KDE 3 | 310 // A helper function for gtk_message_dialog_new() to work around a few KDE 3 |
307 // window manager bugs. You should always call it after creating a dialog with | 311 // window manager bugs. You should always call it after creating a dialog with |
308 // gtk_message_dialog_new. | 312 // gtk_message_dialog_new. |
309 void ApplyMessageDialogQuirks(GtkWidget* dialog); | 313 void ApplyMessageDialogQuirks(GtkWidget* dialog); |
310 | 314 |
311 // Performs Cut/Copy/Paste operation on the |window|. | 315 // Performs Cut/Copy/Paste operation on the |window|'s |web_contents|. |
312 void DoCut(BrowserWindow* window); | 316 void DoCut(GtkWindow* window, content::WebContents* web_contents); |
313 void DoCopy(BrowserWindow* window); | 317 void DoCopy(GtkWindow* window, content::WebContents* web_contents); |
314 void DoPaste(BrowserWindow* window); | 318 void DoPaste(GtkWindow* window, content::WebContents* web_contents); |
319 | |
320 // Ubuntu patches their version of GTK+ to that there is always a | |
321 // gripper in the bottom right corner of the window. We always need to | |
322 // disable this feature since we can't communicate this to WebKit easily. | |
323 void DisableResizeGrip(GtkWindow* window); | |
324 | |
325 GdkCursorType GdkWindowEdgeToGdkCursorType(GdkWindowEdge edge); | |
jianli
2012/08/09 00:52:51
nit: add comment. I have no problem to understand
jennb
2012/08/10 18:45:42
Done.
| |
315 | 326 |
316 } // namespace gtk_util | 327 } // namespace gtk_util |
317 | 328 |
318 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ | 329 #endif // CHROME_BROWSER_UI_GTK_GTK_UTIL_H_ |
OLD | NEW |