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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 class Accelerator; | 25 class Accelerator; |
26 } | 26 } |
27 | 27 |
28 namespace libgtk2ui { | 28 namespace libgtk2ui { |
29 | 29 |
30 void GtkInitFromCommandLine(const base::CommandLine& command_line); | 30 void GtkInitFromCommandLine(const base::CommandLine& command_line); |
31 | 31 |
32 // Returns the name of the ".desktop" file associated with our running process. | 32 // Returns the name of the ".desktop" file associated with our running process. |
33 std::string GetDesktopName(base::Environment* env); | 33 std::string GetDesktopName(base::Environment* env); |
34 | 34 |
35 // Show the image for the given menu item, even if the user's default is to not | |
36 // show images. Only to be used for favicons or other menus where the image is | |
37 // crucial to its functionality. | |
38 void SetAlwaysShowImage(GtkWidget* image_menu_item); | |
39 | |
40 guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator); | 35 guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator); |
41 | 36 |
42 GdkModifierType GetGdkModifierForAccelerator( | 37 GdkModifierType GetGdkModifierForAccelerator( |
43 const ui::Accelerator& accelerator); | 38 const ui::Accelerator& accelerator); |
44 | 39 |
45 // Translates event flags into plaform independent event flags. | 40 // Translates event flags into plaform independent event flags. |
46 int EventFlagsFromGdkState(guint state); | 41 int EventFlagsFromGdkState(guint state); |
47 | 42 |
48 // Sets |dialog| as transient for |parent|, which will keep it on top and center | 43 // Sets |dialog| as transient for |parent|, which will keep it on top and center |
49 // it above |parent|. Do nothing if |parent| is NULL. | 44 // it above |parent|. Do nothing if |parent| is NULL. |
50 void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent); | 45 void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent); |
51 | 46 |
52 // Gets the transient parent aura window for |dialog|. | 47 // Gets the transient parent aura window for |dialog|. |
53 aura::Window* GetAuraTransientParent(GtkWidget* dialog); | 48 aura::Window* GetAuraTransientParent(GtkWidget* dialog); |
54 | 49 |
55 // Clears the transient parent for |dialog|. | 50 // Clears the transient parent for |dialog|. |
56 void ClearAuraTransientParent(GtkWidget* dialog); | 51 void ClearAuraTransientParent(GtkWidget* dialog); |
57 | 52 |
58 // Converts a NativeTheme state to a GtkStateType. | |
59 GtkStateType GetGtkState(ui::NativeTheme::State state); | |
60 | |
61 } // namespace libgtk2ui | 53 } // namespace libgtk2ui |
62 | 54 |
63 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ | 55 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UTIL_H_ |
OLD | NEW |