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 <memory> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" | 15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" |
16 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" | 16 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h" |
17 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" | 17 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" |
18 #include "ui/gfx/color_utils.h" | 18 #include "ui/gfx/color_utils.h" |
19 #include "ui/views/linux_ui/linux_ui.h" | 19 #include "ui/views/linux_ui/linux_ui.h" |
20 #include "ui/views/window/frame_buttons.h" | 20 #include "ui/views/window/frame_buttons.h" |
21 | 21 |
22 typedef struct _GtkBorder GtkBorder; | 22 typedef struct _GtkBorder GtkBorder; |
23 typedef struct _GtkStyle GtkStyle; | 23 typedef struct _GtkStyle GtkStyle; |
(...skipping 23 matching lines...) Expand all Loading... |
47 // Setters used by GConfListener: | 47 // Setters used by GConfListener: |
48 void SetWindowButtonOrdering( | 48 void SetWindowButtonOrdering( |
49 const std::vector<views::FrameButton>& leading_buttons, | 49 const std::vector<views::FrameButton>& leading_buttons, |
50 const std::vector<views::FrameButton>& trailing_buttons); | 50 const std::vector<views::FrameButton>& trailing_buttons); |
51 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); | 51 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); |
52 | 52 |
53 // Called when gtk style changes | 53 // Called when gtk style changes |
54 void ResetStyle(); | 54 void ResetStyle(); |
55 | 55 |
56 // ui::LinuxInputMethodContextFactory: | 56 // ui::LinuxInputMethodContextFactory: |
57 scoped_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( | 57 std::unique_ptr<ui::LinuxInputMethodContext> CreateInputMethodContext( |
58 ui::LinuxInputMethodContextDelegate* delegate, | 58 ui::LinuxInputMethodContextDelegate* delegate, |
59 bool is_simple) const override; | 59 bool is_simple) const override; |
60 | 60 |
61 // gfx::LinuxFontDelegate: | 61 // gfx::LinuxFontDelegate: |
62 gfx::FontRenderParams GetDefaultFontRenderParams() const override; | 62 gfx::FontRenderParams GetDefaultFontRenderParams() const override; |
63 void GetDefaultFontDescription( | 63 void GetDefaultFontDescription( |
64 std::string* family_out, | 64 std::string* family_out, |
65 int* size_pixels_out, | 65 int* size_pixels_out, |
66 int* style_out, | 66 int* style_out, |
67 gfx::FontRenderParams* params_out) const override; | 67 gfx::FontRenderParams* params_out) const override; |
(...skipping 17 matching lines...) Expand all Loading... |
85 SkColor GetActiveSelectionFgColor() const override; | 85 SkColor GetActiveSelectionFgColor() const override; |
86 SkColor GetInactiveSelectionBgColor() const override; | 86 SkColor GetInactiveSelectionBgColor() const override; |
87 SkColor GetInactiveSelectionFgColor() const override; | 87 SkColor GetInactiveSelectionFgColor() const override; |
88 double GetCursorBlinkInterval() const override; | 88 double GetCursorBlinkInterval() const override; |
89 ui::NativeTheme* GetNativeTheme(aura::Window* window) const override; | 89 ui::NativeTheme* GetNativeTheme(aura::Window* window) const override; |
90 void SetNativeThemeOverride(const NativeThemeGetter& callback) override; | 90 void SetNativeThemeOverride(const NativeThemeGetter& callback) override; |
91 bool GetDefaultUsesSystemTheme() const override; | 91 bool GetDefaultUsesSystemTheme() const override; |
92 void SetDownloadCount(int count) const override; | 92 void SetDownloadCount(int count) const override; |
93 void SetProgressFraction(float percentage) const override; | 93 void SetProgressFraction(float percentage) const override; |
94 bool IsStatusIconSupported() const override; | 94 bool IsStatusIconSupported() const override; |
95 scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( | 95 std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( |
96 const gfx::ImageSkia& image, | 96 const gfx::ImageSkia& image, |
97 const base::string16& tool_tip) const override; | 97 const base::string16& tool_tip) const override; |
98 gfx::Image GetIconForContentType(const std::string& content_type, | 98 gfx::Image GetIconForContentType(const std::string& content_type, |
99 int size) const override; | 99 int size) const override; |
100 scoped_ptr<views::Border> CreateNativeBorder( | 100 std::unique_ptr<views::Border> CreateNativeBorder( |
101 views::LabelButton* owning_button, | 101 views::LabelButton* owning_button, |
102 scoped_ptr<views::LabelButtonBorder> border) override; | 102 std::unique_ptr<views::LabelButtonBorder> border) override; |
103 void AddWindowButtonOrderObserver( | 103 void AddWindowButtonOrderObserver( |
104 views::WindowButtonOrderObserver* observer) override; | 104 views::WindowButtonOrderObserver* observer) override; |
105 void RemoveWindowButtonOrderObserver( | 105 void RemoveWindowButtonOrderObserver( |
106 views::WindowButtonOrderObserver* observer) override; | 106 views::WindowButtonOrderObserver* observer) override; |
107 bool UnityIsRunning() override; | 107 bool UnityIsRunning() override; |
108 NonClientMiddleClickAction GetNonClientMiddleClickAction() override; | 108 NonClientMiddleClickAction GetNonClientMiddleClickAction() override; |
109 void NotifyWindowManagerStartupComplete() override; | 109 void NotifyWindowManagerStartupComplete() override; |
110 | 110 |
111 // ui::TextEditKeybindingDelegate: | 111 // ui::TextEditKeybindingDelegate: |
112 bool MatchEvent(const ui::Event& event, | 112 bool MatchEvent(const ui::Event& event, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 // Details about the default UI font. | 198 // Details about the default UI font. |
199 std::string default_font_family_; | 199 std::string default_font_family_; |
200 int default_font_size_pixels_; | 200 int default_font_size_pixels_; |
201 int default_font_style_; // Bitfield of gfx::Font::Style values. | 201 int default_font_style_; // Bitfield of gfx::Font::Style values. |
202 gfx::FontRenderParams default_font_render_params_; | 202 gfx::FontRenderParams default_font_render_params_; |
203 | 203 |
204 #if defined(USE_GCONF) | 204 #if defined(USE_GCONF) |
205 // Currently, the only source of window button configuration. This will | 205 // Currently, the only source of window button configuration. This will |
206 // change if we ever have to support XFCE's configuration system or KDE's. | 206 // change if we ever have to support XFCE's configuration system or KDE's. |
207 scoped_ptr<GConfListener> gconf_listener_; | 207 std::unique_ptr<GConfListener> gconf_listener_; |
208 #endif // defined(USE_GCONF) | 208 #endif // defined(USE_GCONF) |
209 | 209 |
210 // If either of these vectors are non-empty, they represent the current | 210 // If either of these vectors are non-empty, they represent the current |
211 // window button configuration. | 211 // window button configuration. |
212 std::vector<views::FrameButton> leading_buttons_; | 212 std::vector<views::FrameButton> leading_buttons_; |
213 std::vector<views::FrameButton> trailing_buttons_; | 213 std::vector<views::FrameButton> trailing_buttons_; |
214 | 214 |
215 scoped_ptr<Gtk2KeyBindingsHandler> key_bindings_handler_; | 215 std::unique_ptr<Gtk2KeyBindingsHandler> key_bindings_handler_; |
216 | 216 |
217 // Objects to notify when the window frame button order changes. | 217 // Objects to notify when the window frame button order changes. |
218 base::ObserverList<views::WindowButtonOrderObserver> observer_list_; | 218 base::ObserverList<views::WindowButtonOrderObserver> observer_list_; |
219 | 219 |
220 // Whether we should lower the window on a middle click to the non client | 220 // Whether we should lower the window on a middle click to the non client |
221 // area. | 221 // area. |
222 NonClientMiddleClickAction middle_click_action_; | 222 NonClientMiddleClickAction middle_click_action_; |
223 | 223 |
224 // Image cache of lazily created images. | 224 // Image cache of lazily created images. |
225 mutable ImageCache gtk_images_; | 225 mutable ImageCache gtk_images_; |
(...skipping 11 matching lines...) Expand all Loading... |
237 } // namespace libgtk2ui | 237 } // namespace libgtk2ui |
238 | 238 |
239 // Access point to the GTK2 desktop system. This should be the only symbol that | 239 // Access point to the GTK2 desktop system. This should be the only symbol that |
240 // is exported in the library; everything else should be used through the | 240 // is exported in the library; everything else should be used through the |
241 // interface, because eventually this .so will be loaded through dlopen at | 241 // interface, because eventually this .so will be loaded through dlopen at |
242 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or | 242 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or |
243 // QT or whatever. | 243 // QT or whatever. |
244 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); | 244 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); |
245 | 245 |
246 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ | 246 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ |
OLD | NEW |