| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" | 14 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" |
| 15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h" | 15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h" |
| 16 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" | 16 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" |
| 17 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" | 17 #include "chrome/browser/ui/libgtk2ui/owned_widget_gtk2.h" |
| 18 #include "content/public/browser/keybinding_handler_factory_aurax11.h" |
| 18 #include "ui/gfx/color_utils.h" | 19 #include "ui/gfx/color_utils.h" |
| 19 #include "ui/gfx/geometry/insets.h" | 20 #include "ui/gfx/geometry/insets.h" |
| 20 #include "ui/views/linux_ui/linux_ui.h" | 21 #include "ui/views/linux_ui/linux_ui.h" |
| 21 #include "ui/views/window/frame_buttons.h" | 22 #include "ui/views/window/frame_buttons.h" |
| 22 | 23 |
| 23 typedef struct _GdkColor GdkColor; | 24 typedef struct _GdkColor GdkColor; |
| 24 typedef struct _GtkBorder GtkBorder; | 25 typedef struct _GtkBorder GtkBorder; |
| 25 typedef struct _GtkStyle GtkStyle; | 26 typedef struct _GtkStyle GtkStyle; |
| 26 typedef struct _GtkWidget GtkWidget; | 27 typedef struct _GtkWidget GtkWidget; |
| 27 | 28 |
| 28 class SkBitmap; | 29 class SkBitmap; |
| 29 | 30 |
| 30 namespace gfx { | 31 namespace gfx { |
| 31 class Image; | 32 class Image; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace libgtk2ui { | 35 namespace libgtk2ui { |
| 35 class Gtk2Border; | 36 class Gtk2Border; |
| 36 class Gtk2SignalRegistrar; | 37 class Gtk2SignalRegistrar; |
| 37 class GConfTitlebarListener; | 38 class GConfTitlebarListener; |
| 38 | 39 |
| 39 // Interface to GTK2 desktop features. | 40 // Interface to GTK2 desktop features. |
| 40 // | 41 // |
| 41 class Gtk2UI : public views::LinuxUI { | 42 class Gtk2UI : public views::LinuxUI, |
| 43 public content::KeybindingHandlerFactoryAuraX11 { |
| 42 public: | 44 public: |
| 43 Gtk2UI(); | 45 Gtk2UI(); |
| 44 virtual ~Gtk2UI(); | 46 virtual ~Gtk2UI(); |
| 45 | 47 |
| 46 void SetWindowButtonOrdering( | 48 void SetWindowButtonOrdering( |
| 47 const std::vector<views::FrameButton>& leading_buttons, | 49 const std::vector<views::FrameButton>& leading_buttons, |
| 48 const std::vector<views::FrameButton>& trailing_buttons); | 50 const std::vector<views::FrameButton>& trailing_buttons); |
| 49 | 51 |
| 50 // Draws the GTK button border for state |gtk_state| onto a bitmap. | 52 // Draws the GTK button border for state |gtk_state| onto a bitmap. |
| 51 SkBitmap DrawGtkButtonBorder(int gtk_state, | 53 SkBitmap DrawGtkButtonBorder(int gtk_state, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 views::WindowButtonOrderObserver* observer) OVERRIDE; | 105 views::WindowButtonOrderObserver* observer) OVERRIDE; |
| 104 virtual void RemoveWindowButtonOrderObserver( | 106 virtual void RemoveWindowButtonOrderObserver( |
| 105 views::WindowButtonOrderObserver* observer) OVERRIDE; | 107 views::WindowButtonOrderObserver* observer) OVERRIDE; |
| 106 virtual void AddNativeThemeChangeObserver( | 108 virtual void AddNativeThemeChangeObserver( |
| 107 views::NativeThemeChangeObserver* observer) OVERRIDE; | 109 views::NativeThemeChangeObserver* observer) OVERRIDE; |
| 108 virtual void RemoveNativeThemeChangeObserver( | 110 virtual void RemoveNativeThemeChangeObserver( |
| 109 views::NativeThemeChangeObserver* observer) OVERRIDE; | 111 views::NativeThemeChangeObserver* observer) OVERRIDE; |
| 110 virtual bool UnityIsRunning() OVERRIDE; | 112 virtual bool UnityIsRunning() OVERRIDE; |
| 111 virtual void NotifyWindowManagerStartupComplete() OVERRIDE; | 113 virtual void NotifyWindowManagerStartupComplete() OVERRIDE; |
| 112 | 114 |
| 115 // content::KeybindingHandlerFactoryAuraX11: |
| 116 virtual content::KeybindingHandlerAuraX11* Create() OVERRIDE; |
| 117 |
| 113 private: | 118 private: |
| 114 typedef std::map<int, SkColor> ColorMap; | 119 typedef std::map<int, SkColor> ColorMap; |
| 115 typedef std::map<int, color_utils::HSL> TintMap; | 120 typedef std::map<int, color_utils::HSL> TintMap; |
| 116 typedef std::map<int, gfx::Image> ImageCache; | 121 typedef std::map<int, gfx::Image> ImageCache; |
| 117 | 122 |
| 118 // This method returns the colors webkit will use for the scrollbars. When no | 123 // This method returns the colors webkit will use for the scrollbars. When no |
| 119 // colors are specified by the GTK+ theme, this function averages of the | 124 // colors are specified by the GTK+ theme, this function averages of the |
| 120 // thumb part and of the track colors. | 125 // thumb part and of the track colors. |
| 121 void GetScrollbarColors(GdkColor* thumb_active_color, | 126 void GetScrollbarColors(GdkColor* thumb_active_color, |
| 122 GdkColor* thumb_inactive_color, | 127 GdkColor* thumb_inactive_color, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } // namespace libgtk2ui | 258 } // namespace libgtk2ui |
| 254 | 259 |
| 255 // Access point to the GTK2 desktop system. This should be the only symbol that | 260 // Access point to the GTK2 desktop system. This should be the only symbol that |
| 256 // is exported in the library; everything else should be used through the | 261 // is exported in the library; everything else should be used through the |
| 257 // interface, because eventually this .so will be loaded through dlopen at | 262 // interface, because eventually this .so will be loaded through dlopen at |
| 258 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or | 263 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or |
| 259 // QT or whatever. | 264 // QT or whatever. |
| 260 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); | 265 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); |
| 261 | 266 |
| 262 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 267 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
| OLD | NEW |