OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_VIEWS_LINUX_UI_LINUX_UI_H_ | 5 #ifndef UI_VIEWS_LINUX_UI_LINUX_UI_H_ |
6 #define UI_VIEWS_LINUX_UI_LINUX_UI_H_ | 6 #define UI_VIEWS_LINUX_UI_LINUX_UI_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/callback.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
11 #include "ui/base/ime/linux/linux_input_method_context_factory.h" | 12 #include "ui/base/ime/linux/linux_input_method_context_factory.h" |
12 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" | 13 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" |
13 #include "ui/gfx/linux_font_delegate.h" | 14 #include "ui/gfx/linux_font_delegate.h" |
14 #include "ui/shell_dialogs/linux_shell_dialog.h" | 15 #include "ui/shell_dialogs/linux_shell_dialog.h" |
15 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
16 #include "ui/views/linux_ui/status_icon_linux.h" | 17 #include "ui/views/linux_ui/status_icon_linux.h" |
17 #include "ui/views/views_export.h" | 18 #include "ui/views/views_export.h" |
18 | 19 |
19 // The main entrypoint into Linux toolkit specific code. GTK code should only | 20 // The main entrypoint into Linux toolkit specific code. GTK code should only |
20 // be executed behind this interface. | 21 // be executed behind this interface. |
21 | 22 |
| 23 namespace aura { |
| 24 class Window; |
| 25 } |
| 26 |
22 namespace gfx { | 27 namespace gfx { |
23 class Image; | 28 class Image; |
24 } | 29 } |
25 | 30 |
26 namespace ui { | 31 namespace ui { |
27 class NativeTheme; | 32 class NativeTheme; |
28 } | 33 } |
29 | 34 |
30 namespace views { | 35 namespace views { |
31 class Border; | 36 class Border; |
(...skipping 16 matching lines...) Expand all Loading... |
48 public: | 53 public: |
49 // Describes the window management actions that could be taken in response to | 54 // Describes the window management actions that could be taken in response to |
50 // a middle click in the non client area. | 55 // a middle click in the non client area. |
51 enum NonClientMiddleClickAction { | 56 enum NonClientMiddleClickAction { |
52 MIDDLE_CLICK_ACTION_NONE, | 57 MIDDLE_CLICK_ACTION_NONE, |
53 MIDDLE_CLICK_ACTION_LOWER, | 58 MIDDLE_CLICK_ACTION_LOWER, |
54 MIDDLE_CLICK_ACTION_MINIMIZE, | 59 MIDDLE_CLICK_ACTION_MINIMIZE, |
55 MIDDLE_CLICK_ACTION_TOGGLE_MAXIMIZE | 60 MIDDLE_CLICK_ACTION_TOGGLE_MAXIMIZE |
56 }; | 61 }; |
57 | 62 |
| 63 typedef base::Callback<ui::NativeTheme*(aura::Window* window)> |
| 64 NativeThemeGetter; |
| 65 |
58 virtual ~LinuxUI() {} | 66 virtual ~LinuxUI() {} |
59 | 67 |
60 // Sets the dynamically loaded singleton that draws the desktop native UI. | 68 // Sets the dynamically loaded singleton that draws the desktop native UI. |
61 static void SetInstance(LinuxUI* instance); | 69 static void SetInstance(LinuxUI* instance); |
62 | 70 |
63 // Returns a LinuxUI instance for the toolkit used in the user's desktop | 71 // Returns a LinuxUI instance for the toolkit used in the user's desktop |
64 // environment. | 72 // environment. |
65 // | 73 // |
66 // Can return NULL, in case no toolkit has been set. (For example, if we're | 74 // Can return NULL, in case no toolkit has been set. (For example, if we're |
67 // running with the "--ash" flag.) | 75 // running with the "--ash" flag.) |
(...skipping 12 matching lines...) Expand all Loading... |
80 virtual SkColor GetThumbInactiveColor() const = 0; | 88 virtual SkColor GetThumbInactiveColor() const = 0; |
81 virtual SkColor GetTrackColor() const = 0; | 89 virtual SkColor GetTrackColor() const = 0; |
82 virtual SkColor GetActiveSelectionBgColor() const = 0; | 90 virtual SkColor GetActiveSelectionBgColor() const = 0; |
83 virtual SkColor GetActiveSelectionFgColor() const = 0; | 91 virtual SkColor GetActiveSelectionFgColor() const = 0; |
84 virtual SkColor GetInactiveSelectionBgColor() const = 0; | 92 virtual SkColor GetInactiveSelectionBgColor() const = 0; |
85 virtual SkColor GetInactiveSelectionFgColor() const = 0; | 93 virtual SkColor GetInactiveSelectionFgColor() const = 0; |
86 virtual double GetCursorBlinkInterval() const = 0; | 94 virtual double GetCursorBlinkInterval() const = 0; |
87 | 95 |
88 // Returns a NativeTheme that will provide system colors and draw system | 96 // Returns a NativeTheme that will provide system colors and draw system |
89 // style widgets. | 97 // style widgets. |
90 virtual ui::NativeTheme* GetNativeTheme() const = 0; | 98 virtual ui::NativeTheme* GetNativeTheme(aura::Window* window) const = 0; |
| 99 |
| 100 // Used to set an override NativeTheme. |
| 101 virtual void SetNativeThemeOverride(const NativeThemeGetter& callback) = 0; |
91 | 102 |
92 // Returns whether we should be using the native theme provided by this | 103 // Returns whether we should be using the native theme provided by this |
93 // object by default. | 104 // object by default. |
94 virtual bool GetDefaultUsesSystemTheme() const = 0; | 105 virtual bool GetDefaultUsesSystemTheme() const = 0; |
95 | 106 |
96 // Sets visual properties in the desktop environment related to download | 107 // Sets visual properties in the desktop environment related to download |
97 // progress, if available. | 108 // progress, if available. |
98 virtual void SetDownloadCount(int count) const = 0; | 109 virtual void SetDownloadCount(int count) const = 0; |
99 virtual void SetProgressFraction(float percentage) const = 0; | 110 virtual void SetProgressFraction(float percentage) const = 0; |
100 | 111 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Notifies the window manager that start up has completed. | 154 // Notifies the window manager that start up has completed. |
144 // Normally Chromium opens a new window on startup and GTK does this | 155 // Normally Chromium opens a new window on startup and GTK does this |
145 // automatically. In case Chromium does not open a new window on startup, | 156 // automatically. In case Chromium does not open a new window on startup, |
146 // e.g. an existing browser window already exists, this should be called. | 157 // e.g. an existing browser window already exists, this should be called. |
147 virtual void NotifyWindowManagerStartupComplete() = 0; | 158 virtual void NotifyWindowManagerStartupComplete() = 0; |
148 }; | 159 }; |
149 | 160 |
150 } // namespace views | 161 } // namespace views |
151 | 162 |
152 #endif // UI_VIEWS_LINUX_UI_LINUX_UI_H_ | 163 #endif // UI_VIEWS_LINUX_UI_LINUX_UI_H_ |
OLD | NEW |