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