| 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 "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/base/ime/linux/linux_input_method_context_factory.h" | 9 #include "ui/base/ime/linux/linux_input_method_context_factory.h" |
| 10 #include "ui/gfx/linux_font_delegate.h" | 10 #include "ui/gfx/linux_font_delegate.h" |
| 11 #include "ui/shell_dialogs/linux_shell_dialog.h" | 11 #include "ui/shell_dialogs/linux_shell_dialog.h" |
| 12 #include "ui/views/controls/button/button.h" |
| 12 #include "ui/views/linux_ui/status_icon_linux.h" | 13 #include "ui/views/linux_ui/status_icon_linux.h" |
| 13 #include "ui/views/views_export.h" | 14 #include "ui/views/views_export.h" |
| 14 | 15 |
| 15 // The main entrypoint into Linux toolkit specific code. GTK code should only | 16 // The main entrypoint into Linux toolkit specific code. GTK code should only |
| 16 // be executed behind this interface. | 17 // be executed behind this interface. |
| 17 | 18 |
| 18 namespace gfx { | 19 namespace gfx { |
| 19 class Image; | 20 class Image; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace ui { | 23 namespace ui { |
| 23 class NativeTheme; | 24 class NativeTheme; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace views { | 27 namespace views { |
| 28 class Border; |
| 29 class CustomButton; |
| 30 class View; |
| 27 class WindowButtonOrderObserver; | 31 class WindowButtonOrderObserver; |
| 28 | 32 |
| 29 // Adapter class with targets to render like different toolkits. Set by any | 33 // Adapter class with targets to render like different toolkits. Set by any |
| 30 // project that wants to do linux desktop native rendering. | 34 // project that wants to do linux desktop native rendering. |
| 31 // | 35 // |
| 32 // TODO(erg): We're hardcoding GTK2, when we'll need to have backends for (at | 36 // TODO(erg): We're hardcoding GTK2, when we'll need to have backends for (at |
| 33 // minimum) GTK2 and GTK3. LinuxUI::instance() should actually be a very | 37 // minimum) GTK2 and GTK3. LinuxUI::instance() should actually be a very |
| 34 // complex method that pokes around with dlopen against a libuigtk2.so, a | 38 // complex method that pokes around with dlopen against a libuigtk2.so, a |
| 35 // liuigtk3.so, etc. | 39 // liuigtk3.so, etc. |
| 36 class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory, | 40 class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 65 virtual SkColor GetActiveSelectionFgColor() const = 0; | 69 virtual SkColor GetActiveSelectionFgColor() const = 0; |
| 66 virtual SkColor GetInactiveSelectionBgColor() const = 0; | 70 virtual SkColor GetInactiveSelectionBgColor() const = 0; |
| 67 virtual SkColor GetInactiveSelectionFgColor() const = 0; | 71 virtual SkColor GetInactiveSelectionFgColor() const = 0; |
| 68 virtual double GetCursorBlinkInterval() const = 0; | 72 virtual double GetCursorBlinkInterval() const = 0; |
| 69 | 73 |
| 70 // Returns a NativeTheme that will provide system colors and draw system | 74 // Returns a NativeTheme that will provide system colors and draw system |
| 71 // style widgets. | 75 // style widgets. |
| 72 virtual ui::NativeTheme* GetNativeTheme() const = 0; | 76 virtual ui::NativeTheme* GetNativeTheme() const = 0; |
| 73 | 77 |
| 74 virtual void SetUseSystemTheme(bool use_system_theme) = 0; | 78 virtual void SetUseSystemTheme(bool use_system_theme) = 0; |
| 79 virtual bool GetUseSystemTheme() const = 0; |
| 75 | 80 |
| 76 // Returns whether we should be using the native theme provided by this | 81 // Returns whether we should be using the native theme provided by this |
| 77 // object by default. | 82 // object by default. |
| 78 virtual bool GetDefaultUsesSystemTheme() const = 0; | 83 virtual bool GetDefaultUsesSystemTheme() const = 0; |
| 79 | 84 |
| 80 // Sets visual properties in the desktop environment related to download | 85 // Sets visual properties in the desktop environment related to download |
| 81 // progress, if available. | 86 // progress, if available. |
| 82 virtual void SetDownloadCount(int count) const = 0; | 87 virtual void SetDownloadCount(int count) const = 0; |
| 83 virtual void SetProgressFraction(float percentage) const = 0; | 88 virtual void SetProgressFraction(float percentage) const = 0; |
| 84 | 89 |
| 85 // Checks for platform support for status icons. | 90 // Checks for platform support for status icons. |
| 86 virtual bool IsStatusIconSupported() const = 0; | 91 virtual bool IsStatusIconSupported() const = 0; |
| 87 | 92 |
| 88 // Create a native status icon. | 93 // Create a native status icon. |
| 89 virtual scoped_ptr<StatusIconLinux> CreateLinuxStatusIcon( | 94 virtual scoped_ptr<StatusIconLinux> CreateLinuxStatusIcon( |
| 90 const gfx::ImageSkia& image, | 95 const gfx::ImageSkia& image, |
| 91 const base::string16& tool_tip) const = 0; | 96 const base::string16& tool_tip) const = 0; |
| 92 | 97 |
| 93 // Returns the icon for a given content type from the icon theme. | 98 // Returns the icon for a given content type from the icon theme. |
| 94 // TODO(davidben): Add an observer for the theme changing, so we can drop the | 99 // TODO(davidben): Add an observer for the theme changing, so we can drop the |
| 95 // caches. | 100 // caches. |
| 96 virtual gfx::Image GetIconForContentType( | 101 virtual gfx::Image GetIconForContentType( |
| 97 const std::string& content_type, int size) const = 0; | 102 const std::string& content_type, int size) const = 0; |
| 98 | 103 |
| 104 // Builds a Border which paints the native button style. |
| 105 virtual Border* CreateNativeBorder( |
| 106 views::CustomButton* owning_button, |
| 107 views::Border* border) = 0; |
| 108 |
| 99 // Notifies the observer about changes about how window buttons should be | 109 // Notifies the observer about changes about how window buttons should be |
| 100 // laid out. If the order is anything other than the default min,max,close on | 110 // laid out. If the order is anything other than the default min,max,close on |
| 101 // the right, will immediately send a button change event to the observer. | 111 // the right, will immediately send a button change event to the observer. |
| 102 virtual void AddWindowButtonOrderObserver( | 112 virtual void AddWindowButtonOrderObserver( |
| 103 WindowButtonOrderObserver* observer) = 0; | 113 WindowButtonOrderObserver* observer) = 0; |
| 104 | 114 |
| 105 // Removes the observer from the LinuxUI's list. | 115 // Removes the observer from the LinuxUI's list. |
| 106 virtual void RemoveWindowButtonOrderObserver( | 116 virtual void RemoveWindowButtonOrderObserver( |
| 107 WindowButtonOrderObserver* observer) = 0; | 117 WindowButtonOrderObserver* observer) = 0; |
| 108 | 118 |
| 109 // Determines whether the user's window manager is Unity. | 119 // Determines whether the user's window manager is Unity. |
| 110 virtual bool UnityIsRunning() = 0; | 120 virtual bool UnityIsRunning() = 0; |
| 111 }; | 121 }; |
| 112 | 122 |
| 113 } // namespace views | 123 } // namespace views |
| 114 | 124 |
| 115 #endif // UI_VIEWS_LINUX_UI_LINUX_UI_H_ | 125 #endif // UI_VIEWS_LINUX_UI_LINUX_UI_H_ |
| OLD | NEW |