| 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 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class Gtk2Border; | 37 class Gtk2Border; |
| 38 class Gtk2KeyBindingsHandler; | 38 class Gtk2KeyBindingsHandler; |
| 39 class Gtk2SignalRegistrar; | 39 class Gtk2SignalRegistrar; |
| 40 class GConfListener; | 40 class GConfListener; |
| 41 | 41 |
| 42 // Interface to GTK2 desktop features. | 42 // Interface to GTK2 desktop features. |
| 43 // | 43 // |
| 44 class Gtk2UI : public views::LinuxUI { | 44 class Gtk2UI : public views::LinuxUI { |
| 45 public: | 45 public: |
| 46 Gtk2UI(); | 46 Gtk2UI(); |
| 47 virtual ~Gtk2UI(); | 47 ~Gtk2UI() override; |
| 48 | 48 |
| 49 typedef base::Callback<ui::NativeTheme*(aura::Window* window)> | 49 typedef base::Callback<ui::NativeTheme*(aura::Window* window)> |
| 50 NativeThemeGetter; | 50 NativeThemeGetter; |
| 51 | 51 |
| 52 // Setters used by GConfListener: | 52 // Setters used by GConfListener: |
| 53 void SetWindowButtonOrdering( | 53 void SetWindowButtonOrdering( |
| 54 const std::vector<views::FrameButton>& leading_buttons, | 54 const std::vector<views::FrameButton>& leading_buttons, |
| 55 const std::vector<views::FrameButton>& trailing_buttons); | 55 const std::vector<views::FrameButton>& trailing_buttons); |
| 56 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); | 56 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); |
| 57 | 57 |
| 58 // Draws the GTK button border for state |gtk_state| onto a bitmap. | 58 // Draws the GTK button border for state |gtk_state| onto a bitmap. |
| 59 SkBitmap DrawGtkButtonBorder(int gtk_state, | 59 SkBitmap DrawGtkButtonBorder(int gtk_state, |
| 60 bool focused, | 60 bool focused, |
| 61 bool call_to_action, | 61 bool call_to_action, |
| 62 int width, | 62 int width, |
| 63 int height) const; | 63 int height) const; |
| 64 | 64 |
| 65 // ui::LinuxInputMethodContextFactory: | 65 // ui::LinuxInputMethodContextFactory: |
| 66 virtual scoped_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( | 66 scoped_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( |
| 67 ui::LinuxInputMethodContextDelegate* delegate) const override; | 67 ui::LinuxInputMethodContextDelegate* delegate) const override; |
| 68 | 68 |
| 69 // gfx::LinuxFontDelegate: | 69 // gfx::LinuxFontDelegate: |
| 70 virtual gfx::FontRenderParams GetDefaultFontRenderParams() const override; | 70 gfx::FontRenderParams GetDefaultFontRenderParams() const override; |
| 71 virtual scoped_ptr<gfx::ScopedPangoFontDescription> | 71 scoped_ptr<gfx::ScopedPangoFontDescription> GetDefaultPangoFontDescription() |
| 72 GetDefaultPangoFontDescription() const override; | 72 const override; |
| 73 virtual double GetFontDPI() const override; | 73 double GetFontDPI() const override; |
| 74 | 74 |
| 75 // ui::LinuxShellDialog: | 75 // ui::LinuxShellDialog: |
| 76 virtual ui::SelectFileDialog* CreateSelectFileDialog( | 76 ui::SelectFileDialog* CreateSelectFileDialog( |
| 77 ui::SelectFileDialog::Listener* listener, | 77 ui::SelectFileDialog::Listener* listener, |
| 78 ui::SelectFilePolicy* policy) const override; | 78 ui::SelectFilePolicy* policy) const override; |
| 79 | 79 |
| 80 // ui::LinuxUI: | 80 // ui::LinuxUI: |
| 81 virtual void Initialize() override; | 81 void Initialize() override; |
| 82 virtual gfx::Image GetThemeImageNamed(int id) const override; | 82 gfx::Image GetThemeImageNamed(int id) const override; |
| 83 virtual bool GetColor(int id, SkColor* color) const override; | 83 bool GetColor(int id, SkColor* color) const override; |
| 84 virtual bool HasCustomImage(int id) const override; | 84 bool HasCustomImage(int id) const override; |
| 85 virtual SkColor GetFocusRingColor() const override; | 85 SkColor GetFocusRingColor() const override; |
| 86 virtual SkColor GetThumbActiveColor() const override; | 86 SkColor GetThumbActiveColor() const override; |
| 87 virtual SkColor GetThumbInactiveColor() const override; | 87 SkColor GetThumbInactiveColor() const override; |
| 88 virtual SkColor GetTrackColor() const override; | 88 SkColor GetTrackColor() const override; |
| 89 virtual SkColor GetActiveSelectionBgColor() const override; | 89 SkColor GetActiveSelectionBgColor() const override; |
| 90 virtual SkColor GetActiveSelectionFgColor() const override; | 90 SkColor GetActiveSelectionFgColor() const override; |
| 91 virtual SkColor GetInactiveSelectionBgColor() const override; | 91 SkColor GetInactiveSelectionBgColor() const override; |
| 92 virtual SkColor GetInactiveSelectionFgColor() const override; | 92 SkColor GetInactiveSelectionFgColor() const override; |
| 93 virtual double GetCursorBlinkInterval() const override; | 93 double GetCursorBlinkInterval() const override; |
| 94 virtual ui::NativeTheme* GetNativeTheme(aura::Window* window) const override; | 94 ui::NativeTheme* GetNativeTheme(aura::Window* window) const override; |
| 95 virtual void SetNativeThemeOverride(const NativeThemeGetter& callback) | 95 void SetNativeThemeOverride(const NativeThemeGetter& callback) override; |
| 96 override; | 96 bool GetDefaultUsesSystemTheme() const override; |
| 97 virtual bool GetDefaultUsesSystemTheme() const override; | 97 void SetDownloadCount(int count) const override; |
| 98 virtual void SetDownloadCount(int count) const override; | 98 void SetProgressFraction(float percentage) const override; |
| 99 virtual void SetProgressFraction(float percentage) const override; | 99 bool IsStatusIconSupported() const override; |
| 100 virtual bool IsStatusIconSupported() const override; | 100 scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( |
| 101 virtual scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( | |
| 102 const gfx::ImageSkia& image, | 101 const gfx::ImageSkia& image, |
| 103 const base::string16& tool_tip) const override; | 102 const base::string16& tool_tip) const override; |
| 104 virtual gfx::Image GetIconForContentType( | 103 gfx::Image GetIconForContentType(const std::string& content_type, |
| 105 const std::string& content_type, int size) const override; | 104 int size) const override; |
| 106 virtual scoped_ptr<views::Border> CreateNativeBorder( | 105 scoped_ptr<views::Border> CreateNativeBorder( |
| 107 views::LabelButton* owning_button, | 106 views::LabelButton* owning_button, |
| 108 scoped_ptr<views::LabelButtonBorder> border) override; | 107 scoped_ptr<views::LabelButtonBorder> border) override; |
| 109 virtual void AddWindowButtonOrderObserver( | 108 void AddWindowButtonOrderObserver( |
| 110 views::WindowButtonOrderObserver* observer) override; | 109 views::WindowButtonOrderObserver* observer) override; |
| 111 virtual void RemoveWindowButtonOrderObserver( | 110 void RemoveWindowButtonOrderObserver( |
| 112 views::WindowButtonOrderObserver* observer) override; | 111 views::WindowButtonOrderObserver* observer) override; |
| 113 virtual bool UnityIsRunning() override; | 112 bool UnityIsRunning() override; |
| 114 virtual NonClientMiddleClickAction GetNonClientMiddleClickAction() override; | 113 NonClientMiddleClickAction GetNonClientMiddleClickAction() override; |
| 115 virtual void NotifyWindowManagerStartupComplete() override; | 114 void NotifyWindowManagerStartupComplete() override; |
| 116 | 115 |
| 117 // ui::TextEditKeybindingDelegate: | 116 // ui::TextEditKeybindingDelegate: |
| 118 virtual bool MatchEvent( | 117 bool MatchEvent(const ui::Event& event, |
| 119 const ui::Event& event, | 118 std::vector<ui::TextEditCommandAuraLinux>* commands) override; |
| 120 std::vector<ui::TextEditCommandAuraLinux>* commands) override; | |
| 121 | 119 |
| 122 private: | 120 private: |
| 123 typedef std::map<int, SkColor> ColorMap; | 121 typedef std::map<int, SkColor> ColorMap; |
| 124 typedef std::map<int, color_utils::HSL> TintMap; | 122 typedef std::map<int, color_utils::HSL> TintMap; |
| 125 typedef std::map<int, gfx::Image> ImageCache; | 123 typedef std::map<int, gfx::Image> ImageCache; |
| 126 | 124 |
| 127 // This method returns the colors webkit will use for the scrollbars. When no | 125 // This method returns the colors webkit will use for the scrollbars. When no |
| 128 // colors are specified by the GTK+ theme, this function averages of the | 126 // colors are specified by the GTK+ theme, this function averages of the |
| 129 // thumb part and of the track colors. | 127 // thumb part and of the track colors. |
| 130 void GetScrollbarColors(GdkColor* thumb_active_color, | 128 void GetScrollbarColors(GdkColor* thumb_active_color, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } // namespace libgtk2ui | 261 } // namespace libgtk2ui |
| 264 | 262 |
| 265 // Access point to the GTK2 desktop system. This should be the only symbol that | 263 // Access point to the GTK2 desktop system. This should be the only symbol that |
| 266 // is exported in the library; everything else should be used through the | 264 // is exported in the library; everything else should be used through the |
| 267 // interface, because eventually this .so will be loaded through dlopen at | 265 // interface, because eventually this .so will be loaded through dlopen at |
| 268 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or | 266 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or |
| 269 // QT or whatever. | 267 // QT or whatever. |
| 270 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); | 268 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); |
| 271 | 269 |
| 272 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 270 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
| OLD | NEW |