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 "base/callback.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class Image; | 28 class Image; |
29 } | 29 } |
30 | 30 |
31 namespace ui { | 31 namespace ui { |
32 class NativeTheme; | 32 class NativeTheme; |
33 } | 33 } |
34 | 34 |
35 namespace views { | 35 namespace views { |
36 class Border; | 36 class Border; |
37 class LabelButton; | 37 class LabelButton; |
38 class LabelButtonBorder; | |
39 class View; | 38 class View; |
40 class WindowButtonOrderObserver; | 39 class WindowButtonOrderObserver; |
41 | 40 |
42 // Adapter class with targets to render like different toolkits. Set by any | 41 // Adapter class with targets to render like different toolkits. Set by any |
43 // project that wants to do linux desktop native rendering. | 42 // project that wants to do linux desktop native rendering. |
44 // | 43 // |
45 // TODO(erg): We're hardcoding GTK2, when we'll need to have backends for (at | 44 // TODO(erg): We're hardcoding GTK2, when we'll need to have backends for (at |
46 // minimum) GTK2 and GTK3. LinuxUI::instance() should actually be a very | 45 // minimum) GTK2 and GTK3. LinuxUI::instance() should actually be a very |
47 // complex method that pokes around with dlopen against a libuigtk2.so, a | 46 // complex method that pokes around with dlopen against a libuigtk2.so, a |
48 // liuigtk3.so, etc. | 47 // liuigtk3.so, etc. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 118 |
120 // Returns the icon for a given content type from the icon theme. | 119 // Returns the icon for a given content type from the icon theme. |
121 // TODO(davidben): Add an observer for the theme changing, so we can drop the | 120 // TODO(davidben): Add an observer for the theme changing, so we can drop the |
122 // caches. | 121 // caches. |
123 virtual gfx::Image GetIconForContentType( | 122 virtual gfx::Image GetIconForContentType( |
124 const std::string& content_type, int size) const = 0; | 123 const std::string& content_type, int size) const = 0; |
125 | 124 |
126 // Builds a Border which paints the native button style. | 125 // Builds a Border which paints the native button style. |
127 virtual scoped_ptr<Border> CreateNativeBorder( | 126 virtual scoped_ptr<Border> CreateNativeBorder( |
128 views::LabelButton* owning_button, | 127 views::LabelButton* owning_button, |
129 scoped_ptr<views::LabelButtonBorder> border) = 0; | 128 scoped_ptr<views::Border> border) = 0; |
130 | 129 |
131 // Notifies the observer about changes about how window buttons should be | 130 // Notifies the observer about changes about how window buttons should be |
132 // laid out. If the order is anything other than the default min,max,close on | 131 // laid out. If the order is anything other than the default min,max,close on |
133 // the right, will immediately send a button change event to the observer. | 132 // the right, will immediately send a button change event to the observer. |
134 virtual void AddWindowButtonOrderObserver( | 133 virtual void AddWindowButtonOrderObserver( |
135 WindowButtonOrderObserver* observer) = 0; | 134 WindowButtonOrderObserver* observer) = 0; |
136 | 135 |
137 // Removes the observer from the LinuxUI's list. | 136 // Removes the observer from the LinuxUI's list. |
138 virtual void RemoveWindowButtonOrderObserver( | 137 virtual void RemoveWindowButtonOrderObserver( |
139 WindowButtonOrderObserver* observer) = 0; | 138 WindowButtonOrderObserver* observer) = 0; |
140 | 139 |
141 // Determines whether the user's window manager is Unity. | 140 // Determines whether the user's window manager is Unity. |
142 virtual bool UnityIsRunning() = 0; | 141 virtual bool UnityIsRunning() = 0; |
143 | 142 |
144 // What action we should take when the user middle clicks on non-client | 143 // What action we should take when the user middle clicks on non-client |
145 // area. The default is lowering the window. | 144 // area. The default is lowering the window. |
146 virtual NonClientMiddleClickAction GetNonClientMiddleClickAction() = 0; | 145 virtual NonClientMiddleClickAction GetNonClientMiddleClickAction() = 0; |
147 | 146 |
148 // Notifies the window manager that start up has completed. | 147 // Notifies the window manager that start up has completed. |
149 // Normally Chromium opens a new window on startup and GTK does this | 148 // Normally Chromium opens a new window on startup and GTK does this |
150 // automatically. In case Chromium does not open a new window on startup, | 149 // automatically. In case Chromium does not open a new window on startup, |
151 // e.g. an existing browser window already exists, this should be called. | 150 // e.g. an existing browser window already exists, this should be called. |
152 virtual void NotifyWindowManagerStartupComplete() = 0; | 151 virtual void NotifyWindowManagerStartupComplete() = 0; |
153 }; | 152 }; |
154 | 153 |
155 } // namespace views | 154 } // namespace views |
156 | 155 |
157 #endif // UI_VIEWS_LINUX_UI_LINUX_UI_H_ | 156 #endif // UI_VIEWS_LINUX_UI_LINUX_UI_H_ |
OLD | NEW |