| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GTK_GTK_THEME_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/prefs/pref_change_registrar.h" | 14 #include "base/prefs/pref_change_registrar.h" |
| 15 #include "chrome/browser/themes/theme_service.h" | 15 #include "chrome/browser/themes/theme_service.h" |
| 16 #include "ui/base/glib/glib_integers.h" | 16 #include "ui/base/glib/glib_integers.h" |
| 17 #include "ui/base/gtk/gtk_signal.h" | 17 #include "ui/base/gtk/gtk_signal.h" |
| 18 #include "ui/base/gtk/owned_widget_gtk.h" | 18 #include "ui/base/gtk/owned_widget_gtk.h" |
| 19 #include "ui/gfx/color_utils.h" | 19 #include "ui/gfx/color_utils.h" |
| 20 | 20 |
| 21 class CustomThemeSupplier; |
| 21 class Profile; | 22 class Profile; |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 class NotificationObserver; | 25 class NotificationObserver; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace extensions { | 28 namespace extensions { |
| 28 class Extension; | 29 class Extension; |
| 29 } | 30 } |
| 30 | 31 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 virtual void Init(Profile* profile) OVERRIDE; | 73 virtual void Init(Profile* profile) OVERRIDE; |
| 73 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE; | 74 virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE; |
| 74 virtual gfx::Image GetImageNamed(int id) const OVERRIDE; | 75 virtual gfx::Image GetImageNamed(int id) const OVERRIDE; |
| 75 virtual SkColor GetColor(int id) const OVERRIDE; | 76 virtual SkColor GetColor(int id) const OVERRIDE; |
| 76 virtual bool HasCustomImage(int id) const OVERRIDE; | 77 virtual bool HasCustomImage(int id) const OVERRIDE; |
| 77 virtual void SetTheme(const extensions::Extension* extension) OVERRIDE; | 78 virtual void SetTheme(const extensions::Extension* extension) OVERRIDE; |
| 78 virtual void UseDefaultTheme() OVERRIDE; | 79 virtual void UseDefaultTheme() OVERRIDE; |
| 79 virtual void SetNativeTheme() OVERRIDE; | 80 virtual void SetNativeTheme() OVERRIDE; |
| 80 virtual bool UsingDefaultTheme() const OVERRIDE; | 81 virtual bool UsingDefaultTheme() const OVERRIDE; |
| 81 virtual bool UsingNativeTheme() const OVERRIDE; | 82 virtual bool UsingNativeTheme() const OVERRIDE; |
| 83 virtual void SetCustomDefaultTheme( |
| 84 scoped_refptr<CustomThemeSupplier> theme_supplier) OVERRIDE; |
| 82 virtual bool ShouldInitWithNativeTheme() const OVERRIDE; | 85 virtual bool ShouldInitWithNativeTheme() const OVERRIDE; |
| 83 | 86 |
| 84 // Creates a GtkChromeButton instance, registered with this theme provider, | 87 // Creates a GtkChromeButton instance, registered with this theme provider, |
| 85 // with a "destroy" signal to remove it from our internal list when it goes | 88 // with a "destroy" signal to remove it from our internal list when it goes |
| 86 // away. | 89 // away. |
| 87 GtkWidget* BuildChromeButton(); | 90 GtkWidget* BuildChromeButton(); |
| 88 | 91 |
| 89 // Creates a GtkChromeLinkButton instance. We update its state as theme | 92 // Creates a GtkChromeLinkButton instance. We update its state as theme |
| 90 // changes, and listen for its destruction. | 93 // changes, and listen for its destruction. |
| 91 GtkWidget* BuildChromeLinkButton(const std::string& text); | 94 GtkWidget* BuildChromeLinkButton(const std::string& text); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 310 |
| 308 // The default folder icon and default bookmark icon for the GTK theme. | 311 // The default folder icon and default bookmark icon for the GTK theme. |
| 309 // These are static because the system can only have one theme at a time. | 312 // These are static because the system can only have one theme at a time. |
| 310 // They are cached when they are requested the first time, and cleared when | 313 // They are cached when they are requested the first time, and cleared when |
| 311 // the system theme changes. | 314 // the system theme changes. |
| 312 static base::LazyInstance<gfx::Image> default_folder_icon_; | 315 static base::LazyInstance<gfx::Image> default_folder_icon_; |
| 313 static base::LazyInstance<gfx::Image> default_bookmark_icon_; | 316 static base::LazyInstance<gfx::Image> default_bookmark_icon_; |
| 314 }; | 317 }; |
| 315 | 318 |
| 316 #endif // CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ | 319 #endif // CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ |
| OLD | NEW |