Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_BASE_LINUX_SHELL_LINUX_SHELL_H_ | |
| 6 #define UI_BASE_LINUX_SHELL_LINUX_SHELL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/base/ui_export.h" | |
| 10 #include "third_party/skia/include/core/SkColor.h" | |
| 11 | |
| 12 // The main entrypoint into Linux toolkit specific code. GTK code should only | |
| 13 // be executed behind this interface. | |
| 14 | |
| 15 namespace gfx { | |
| 16 class Image; | |
| 17 } | |
| 18 | |
| 19 namespace ui { | |
| 20 | |
| 21 // Adapter class with targets to render like different toolkits. Set by any | |
| 22 // project that wants to do linux desktop native rendering. | |
| 23 // | |
| 24 // TODO(erg): We're hardcoding GTK2, when we'll need to have backends for (at | |
| 25 // minimum) GTK2 and GTK3. LinuxShell::instance() should actually be a very | |
| 26 // complex method that pokes around with dlopen against a libuigtk2.so, a | |
| 27 // liuigtk3.so, etc. | |
| 28 class UI_EXPORT LinuxUI { | |
| 29 public: | |
| 30 // Sets the dynamically loaded singleton that draws the desktop native UI. | |
| 31 static void SetInstance(LinuxUI* instance); | |
| 32 | |
| 33 // Returns a LinuxShell instance for the toolkit used in the user's desktop | |
| 34 // environment. | |
| 35 // | |
| 36 // Can return NULL, in case no toolkit has been set. (For example, if we're | |
| 37 // running with the "--ash" flag.) | |
| 38 static const LinuxUI* instance(); | |
| 39 | |
| 40 // Returns an themed image per theme_provider.h | |
| 41 virtual bool UseNativeTheme() const = 0; | |
| 42 virtual gfx::Image* GetThemeImageNamed(int id) const = 0; | |
| 43 virtual SkColor GetColor(int id) const = 0; | |
| 44 | |
| 45 virtual ~LinuxUI() {} | |
|
sky
2012/06/06 21:04:07
nit: destructors before all other methods (includi
| |
| 46 }; | |
| 47 | |
| 48 } // namespace ui | |
| 49 | |
| 50 #endif // UI_BASE_LINUX_SHELL_LINUX_SHELL_H_ | |
| OLD | NEW |