OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" | 12 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" |
13 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" | 13 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" |
14 #include "ui/gfx/color_utils.h" | 14 #include "ui/gfx/color_utils.h" |
15 #include "ui/linux_ui/linux_ui.h" | 15 #include "ui/views/linux_ui/linux_ui.h" |
16 | 16 |
17 typedef struct _GdkColor GdkColor; | 17 typedef struct _GdkColor GdkColor; |
18 typedef struct _GtkStyle GtkStyle; | 18 typedef struct _GtkStyle GtkStyle; |
19 typedef struct _GtkWidget GtkWidget; | 19 typedef struct _GtkWidget GtkWidget; |
20 | 20 |
21 class SkBitmap; | 21 class SkBitmap; |
22 | 22 |
23 namespace gfx { | 23 namespace gfx { |
24 class Image; | 24 class Image; |
25 } | 25 } |
26 | 26 |
27 namespace libgtk2ui { | 27 namespace libgtk2ui { |
28 | 28 |
29 // Interface to GTK2 desktop features. | 29 // Interface to GTK2 desktop features. |
30 // | 30 // |
31 class Gtk2UI : public ui::LinuxUI { | 31 class Gtk2UI : public views::LinuxUI { |
32 public: | 32 public: |
33 Gtk2UI(); | 33 Gtk2UI(); |
34 virtual ~Gtk2UI(); | 34 virtual ~Gtk2UI(); |
35 | 35 |
36 // ui::LinuxShellDialog: | 36 // ui::LinuxShellDialog: |
37 virtual ui::SelectFileDialog* CreateSelectFileDialog( | 37 virtual ui::SelectFileDialog* CreateSelectFileDialog( |
38 ui::SelectFileDialog::Listener* listener, | 38 ui::SelectFileDialog::Listener* listener, |
39 ui::SelectFilePolicy* policy) const OVERRIDE; | 39 ui::SelectFilePolicy* policy) const OVERRIDE; |
40 | 40 |
41 // ui::LinuxUI: | 41 // ui::LinuxUI: |
42 virtual bool UseNativeTheme() const OVERRIDE; | 42 virtual bool UseNativeTheme() const OVERRIDE; |
43 virtual gfx::Image GetThemeImageNamed(int id) const OVERRIDE; | 43 virtual gfx::Image GetThemeImageNamed(int id) const OVERRIDE; |
44 virtual bool GetColor(int id, SkColor* color) const OVERRIDE; | 44 virtual bool GetColor(int id, SkColor* color) const OVERRIDE; |
45 virtual bool HasCustomImage(int id) const OVERRIDE; | 45 virtual bool HasCustomImage(int id) const OVERRIDE; |
46 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; | 46 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; |
47 virtual bool GetDefaultUsesSystemTheme() const OVERRIDE; | 47 virtual bool GetDefaultUsesSystemTheme() const OVERRIDE; |
48 virtual void SetDownloadCount(int count) const OVERRIDE; | 48 virtual void SetDownloadCount(int count) const OVERRIDE; |
49 virtual void SetProgressFraction(float percentage) const OVERRIDE; | 49 virtual void SetProgressFraction(float percentage) const OVERRIDE; |
50 virtual bool IsStatusIconSupported() const OVERRIDE; | 50 virtual bool IsStatusIconSupported() const OVERRIDE; |
51 virtual scoped_ptr<StatusIconLinux> CreateLinuxStatusIcon( | 51 virtual scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( |
52 const gfx::ImageSkia& image, | 52 const gfx::ImageSkia& image, |
53 const string16& tool_tip) const OVERRIDE; | 53 const string16& tool_tip) const OVERRIDE; |
54 | 54 |
55 private: | 55 private: |
56 typedef std::map<int, SkColor> ColorMap; | 56 typedef std::map<int, SkColor> ColorMap; |
57 typedef std::map<int, color_utils::HSL> TintMap; | 57 typedef std::map<int, color_utils::HSL> TintMap; |
58 typedef std::map<int, gfx::Image> ImageCache; | 58 typedef std::map<int, gfx::Image> ImageCache; |
59 | 59 |
60 // This method returns the colors webkit will use for the scrollbars. When no | 60 // This method returns the colors webkit will use for the scrollbars. When no |
61 // colors are specified by the GTK+ theme, this function averages of the | 61 // colors are specified by the GTK+ theme, this function averages of the |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 DISALLOW_COPY_AND_ASSIGN(Gtk2UI); | 163 DISALLOW_COPY_AND_ASSIGN(Gtk2UI); |
164 }; | 164 }; |
165 | 165 |
166 } // namespace libgtk2ui | 166 } // namespace libgtk2ui |
167 | 167 |
168 // Access point to the GTK2 desktop system. This should be the only symbol that | 168 // Access point to the GTK2 desktop system. This should be the only symbol that |
169 // is exported in the library; everything else should be used through the | 169 // is exported in the library; everything else should be used through the |
170 // interface, because eventually this .so will be loaded through dlopen at | 170 // interface, because eventually this .so will be loaded through dlopen at |
171 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or | 171 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or |
172 // QT or whatever. | 172 // QT or whatever. |
173 LIBGTK2UI_EXPORT ui::LinuxUI* BuildGtk2UI(); | 173 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); |
174 | 174 |
175 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 175 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
OLD | NEW |