summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/libgtk2ui
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 23:11:38 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 23:11:38 +0000
commit891c9fc9f2505d160d1e5f24790b93235e00dd64 (patch)
treee82e06dfbdbf407d6fd89cd5852cdc48cd0a7c17 /chrome/browser/ui/libgtk2ui
parenta6ffdf597037348733bf270903f4bcd28e9803b8 (diff)
downloadchromium_src-891c9fc9f2505d160d1e5f24790b93235e00dd64.zip
chromium_src-891c9fc9f2505d160d1e5f24790b93235e00dd64.tar.gz
chromium_src-891c9fc9f2505d160d1e5f24790b93235e00dd64.tar.bz2
linux aura: Use Chrome-default NativeTheme as appropriate.
BUG=320896 R=erg@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/66973007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/libgtk2ui')
-rw-r--r--chrome/browser/ui/libgtk2ui/gtk2_ui.cc13
-rw-r--r--chrome/browser/ui/libgtk2ui/gtk2_ui.h5
2 files changed, 11 insertions, 7 deletions
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index a7b1839..6362923 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -310,7 +310,7 @@ color_utils::HSL GetDefaultTint(int id) {
namespace libgtk2ui {
-Gtk2UI::Gtk2UI() {
+Gtk2UI::Gtk2UI() : use_gtk_(false) {
GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
}
@@ -350,10 +350,6 @@ Gtk2UI::~Gtk2UI() {
ClearAllThemeData();
}
-bool Gtk2UI::UseNativeTheme() const {
- return true;
-}
-
gfx::Image Gtk2UI::GetThemeImageNamed(int id) const {
// Try to get our cached version:
ImageCache::const_iterator it = gtk_images_.find(id);
@@ -437,7 +433,12 @@ double Gtk2UI::GetCursorBlinkInterval() const {
}
ui::NativeTheme* Gtk2UI::GetNativeTheme() const {
- return NativeThemeGtk2::instance();
+ return use_gtk_ ? NativeThemeGtk2::instance() :
+ ui::NativeTheme::instance();
+}
+
+void Gtk2UI::SetUseSystemTheme(bool use_system_theme) {
+ use_gtk_ = use_system_theme;
}
bool Gtk2UI::GetDefaultUsesSystemTheme() const {
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.h b/chrome/browser/ui/libgtk2ui/gtk2_ui.h
index e86f747..52fd121 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.h
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.h
@@ -52,7 +52,6 @@ class Gtk2UI : public views::LinuxUI {
// ui::LinuxUI:
virtual void Initialize() OVERRIDE;
- virtual bool UseNativeTheme() const OVERRIDE;
virtual gfx::Image GetThemeImageNamed(int id) const OVERRIDE;
virtual bool GetColor(int id, SkColor* color) const OVERRIDE;
virtual bool HasCustomImage(int id) const OVERRIDE;
@@ -66,6 +65,7 @@ class Gtk2UI : public views::LinuxUI {
virtual SkColor GetInactiveSelectionFgColor() const OVERRIDE;
virtual double GetCursorBlinkInterval() const OVERRIDE;
virtual ui::NativeTheme* GetNativeTheme() const OVERRIDE;
+ virtual void SetUseSystemTheme(bool use_system_theme) OVERRIDE;
virtual bool GetDefaultUsesSystemTheme() const OVERRIDE;
virtual void SetDownloadCount(int count) const OVERRIDE;
virtual void SetProgressFraction(float percentage) const OVERRIDE;
@@ -202,6 +202,9 @@ class Gtk2UI : public views::LinuxUI {
// Image cache of lazily created images.
mutable ImageCache gtk_images_;
+ // Whether to use the Gtk2 version of the native theme.
+ bool use_gtk_;
+
DISALLOW_COPY_AND_ASSIGN(Gtk2UI);
};