Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.h

Issue 243633003: use the right NativeTheme on bubbles + dialogs on Aura Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rejigger Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 27 matching lines...) Expand all
38 class Gtk2SignalRegistrar; 38 class Gtk2SignalRegistrar;
39 class GConfListener; 39 class GConfListener;
40 40
41 // Interface to GTK2 desktop features. 41 // Interface to GTK2 desktop features.
42 // 42 //
43 class Gtk2UI : public views::LinuxUI { 43 class Gtk2UI : public views::LinuxUI {
44 public: 44 public:
45 Gtk2UI(); 45 Gtk2UI();
46 virtual ~Gtk2UI(); 46 virtual ~Gtk2UI();
47 47
48 typedef base::Callback<ui::NativeTheme*(aura::Window* window)>
49 NativeThemeGetter;
50
48 // Setters used by GConfListener: 51 // Setters used by GConfListener:
49 void SetWindowButtonOrdering( 52 void SetWindowButtonOrdering(
50 const std::vector<views::FrameButton>& leading_buttons, 53 const std::vector<views::FrameButton>& leading_buttons,
51 const std::vector<views::FrameButton>& trailing_buttons); 54 const std::vector<views::FrameButton>& trailing_buttons);
52 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action); 55 void SetNonClientMiddleClickAction(NonClientMiddleClickAction action);
53 56
54 // Draws the GTK button border for state |gtk_state| onto a bitmap. 57 // Draws the GTK button border for state |gtk_state| onto a bitmap.
55 SkBitmap DrawGtkButtonBorder(int gtk_state, 58 SkBitmap DrawGtkButtonBorder(int gtk_state,
56 bool focused, 59 bool focused,
57 int width, 60 int width,
(...skipping 25 matching lines...) Expand all
83 virtual bool HasCustomImage(int id) const OVERRIDE; 86 virtual bool HasCustomImage(int id) const OVERRIDE;
84 virtual SkColor GetFocusRingColor() const OVERRIDE; 87 virtual SkColor GetFocusRingColor() const OVERRIDE;
85 virtual SkColor GetThumbActiveColor() const OVERRIDE; 88 virtual SkColor GetThumbActiveColor() const OVERRIDE;
86 virtual SkColor GetThumbInactiveColor() const OVERRIDE; 89 virtual SkColor GetThumbInactiveColor() const OVERRIDE;
87 virtual SkColor GetTrackColor() const OVERRIDE; 90 virtual SkColor GetTrackColor() const OVERRIDE;
88 virtual SkColor GetActiveSelectionBgColor() const OVERRIDE; 91 virtual SkColor GetActiveSelectionBgColor() const OVERRIDE;
89 virtual SkColor GetActiveSelectionFgColor() const OVERRIDE; 92 virtual SkColor GetActiveSelectionFgColor() const OVERRIDE;
90 virtual SkColor GetInactiveSelectionBgColor() const OVERRIDE; 93 virtual SkColor GetInactiveSelectionBgColor() const OVERRIDE;
91 virtual SkColor GetInactiveSelectionFgColor() const OVERRIDE; 94 virtual SkColor GetInactiveSelectionFgColor() const OVERRIDE;
92 virtual double GetCursorBlinkInterval() const OVERRIDE; 95 virtual double GetCursorBlinkInterval() const OVERRIDE;
93 virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE; 96 virtual ui::NativeTheme* GetNativeTheme(aura::Window* window) const OVERRIDE;
97 virtual void SetNativeThemeOverride(const NativeThemeGetter& callback)
98 OVERRIDE;
94 virtual bool GetDefaultUsesSystemTheme() const OVERRIDE; 99 virtual bool GetDefaultUsesSystemTheme() const OVERRIDE;
95 virtual void SetDownloadCount(int count) const OVERRIDE; 100 virtual void SetDownloadCount(int count) const OVERRIDE;
96 virtual void SetProgressFraction(float percentage) const OVERRIDE; 101 virtual void SetProgressFraction(float percentage) const OVERRIDE;
97 virtual bool IsStatusIconSupported() const OVERRIDE; 102 virtual bool IsStatusIconSupported() const OVERRIDE;
98 virtual scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon( 103 virtual scoped_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
99 const gfx::ImageSkia& image, 104 const gfx::ImageSkia& image,
100 const base::string16& tool_tip) const OVERRIDE; 105 const base::string16& tool_tip) const OVERRIDE;
101 virtual gfx::Image GetIconForContentType( 106 virtual gfx::Image GetIconForContentType(
102 const std::string& content_type, int size) const OVERRIDE; 107 const std::string& content_type, int size) const OVERRIDE;
103 virtual scoped_ptr<views::Border> CreateNativeBorder( 108 virtual scoped_ptr<views::Border> CreateNativeBorder(
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // Observers to notify when the theme state changes. 254 // Observers to notify when the theme state changes.
250 ObserverList<views::NativeThemeChangeObserver> theme_change_observers_; 255 ObserverList<views::NativeThemeChangeObserver> theme_change_observers_;
251 256
252 // Whether we should lower the window on a middle click to the non client 257 // Whether we should lower the window on a middle click to the non client
253 // area. 258 // area.
254 NonClientMiddleClickAction middle_click_action_; 259 NonClientMiddleClickAction middle_click_action_;
255 260
256 // Image cache of lazily created images. 261 // Image cache of lazily created images.
257 mutable ImageCache gtk_images_; 262 mutable ImageCache gtk_images_;
258 263
264 // Used to override the native theme for a window. If no override is provided
265 // or the callback returns NULL, Gtk2UI will default to a NativeThemeGtk2
266 // instance.
267 NativeThemeGetter native_theme_overrider_;
268
259 DISALLOW_COPY_AND_ASSIGN(Gtk2UI); 269 DISALLOW_COPY_AND_ASSIGN(Gtk2UI);
260 }; 270 };
261 271
262 } // namespace libgtk2ui 272 } // namespace libgtk2ui
263 273
264 // Access point to the GTK2 desktop system. This should be the only symbol that 274 // Access point to the GTK2 desktop system. This should be the only symbol that
265 // is exported in the library; everything else should be used through the 275 // is exported in the library; everything else should be used through the
266 // interface, because eventually this .so will be loaded through dlopen at 276 // interface, because eventually this .so will be loaded through dlopen at
267 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or 277 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or
268 // QT or whatever. 278 // QT or whatever.
269 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI(); 279 LIBGTK2UI_EXPORT views::LinuxUI* BuildGtk2UI();
270 280
271 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_ 281 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_UI_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698