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_LIBGTK2UI_GTK2_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ |
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 class SkBitmap; | 11 class SkBitmap; |
12 | 12 |
| 13 namespace aura { |
| 14 class Window; |
| 15 } |
| 16 |
13 namespace base { | 17 namespace base { |
14 class CommandLine; | 18 class CommandLine; |
15 class Environment; | 19 class Environment; |
16 } | 20 } |
17 | 21 |
18 namespace ui { | 22 namespace ui { |
19 class Accelerator; | 23 class Accelerator; |
20 } | 24 } |
21 | 25 |
22 namespace libgtk2ui { | 26 namespace libgtk2ui { |
23 | 27 |
24 void GtkInitFromCommandLine(const base::CommandLine& command_line); | 28 void GtkInitFromCommandLine(const base::CommandLine& command_line); |
25 | 29 |
26 // Returns the name of the ".desktop" file associated with our running process. | 30 // Returns the name of the ".desktop" file associated with our running process. |
27 std::string GetDesktopName(base::Environment* env); | 31 std::string GetDesktopName(base::Environment* env); |
28 | 32 |
29 // Show the image for the given menu item, even if the user's default is to not | 33 // Show the image for the given menu item, even if the user's default is to not |
30 // show images. Only to be used for favicons or other menus where the image is | 34 // show images. Only to be used for favicons or other menus where the image is |
31 // crucial to its functionality. | 35 // crucial to its functionality. |
32 void SetAlwaysShowImage(GtkWidget* image_menu_item); | 36 void SetAlwaysShowImage(GtkWidget* image_menu_item); |
33 | 37 |
34 guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator); | 38 guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator); |
35 | 39 |
36 GdkModifierType GetGdkModifierForAccelerator( | 40 GdkModifierType GetGdkModifierForAccelerator( |
37 const ui::Accelerator& accelerator); | 41 const ui::Accelerator& accelerator); |
38 | 42 |
39 // Translates event flags into plaform independent event flags. | 43 // Translates event flags into plaform independent event flags. |
40 int EventFlagsFromGdkState(guint state); | 44 int EventFlagsFromGdkState(guint state); |
41 | 45 |
| 46 // Sets |dialog| as transient for |parent|, which will keep it on top and center |
| 47 // it above |parent|. |
| 48 void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent); |
| 49 |
| 50 // Gets the transient parent aura window for |dialog|. |
| 51 aura::Window* GetAuraTransientParent(GtkWidget* dialog); |
| 52 |
| 53 // Clears the transient parent for |dialog|. |
| 54 void ClearAuraTransientParent(GtkWidget* dialog); |
| 55 |
42 } // namespace libgtk2ui | 56 } // namespace libgtk2ui |
43 | 57 |
44 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ | 58 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ |
OLD | NEW |