| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/themes/theme_service_aurax11.h" | 5 #include "chrome/browser/themes/theme_service_aurax11.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/themes/custom_theme_supplier.h" | 10 #include "chrome/browser/themes/custom_theme_supplier.h" |
| 11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
| 13 #include "ui/native_theme/native_theme_aura.h" | 13 #include "ui/native_theme/native_theme_aura.h" |
| 14 #include "ui/views/linux_ui/linux_ui.h" | 14 #include "ui/views/linux_ui/linux_ui.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 class SystemThemeX11 : public CustomThemeSupplier { | 18 class SystemThemeX11 : public CustomThemeSupplier { |
| 19 public: | 19 public: |
| 20 explicit SystemThemeX11(PrefService* pref_service); | 20 explicit SystemThemeX11(PrefService* pref_service); |
| 21 | 21 |
| 22 // Overridden from CustomThemeSupplier: | 22 // Overridden from CustomThemeSupplier: |
| 23 virtual void StartUsingTheme() override; | 23 void StartUsingTheme() override; |
| 24 virtual void StopUsingTheme() override; | 24 void StopUsingTheme() override; |
| 25 virtual bool GetColor(int id, SkColor* color) const override; | 25 bool GetColor(int id, SkColor* color) const override; |
| 26 virtual gfx::Image GetImageNamed(int id) override; | 26 gfx::Image GetImageNamed(int id) override; |
| 27 virtual bool HasCustomImage(int id) const override; | 27 bool HasCustomImage(int id) const override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 virtual ~SystemThemeX11(); | 30 ~SystemThemeX11() override; |
| 31 | 31 |
| 32 // These pointers are not owned by us. | 32 // These pointers are not owned by us. |
| 33 views::LinuxUI* const linux_ui_; | 33 views::LinuxUI* const linux_ui_; |
| 34 PrefService* const pref_service_; | 34 PrefService* const pref_service_; |
| 35 | 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(SystemThemeX11); | 36 DISALLOW_COPY_AND_ASSIGN(SystemThemeX11); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 SystemThemeX11::SystemThemeX11(PrefService* pref_service) | 39 SystemThemeX11::SystemThemeX11(PrefService* pref_service) |
| 40 : CustomThemeSupplier(NATIVE_X11), | 40 : CustomThemeSupplier(NATIVE_X11), |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 bool ThemeServiceAuraX11::UsingDefaultTheme() const { | 89 bool ThemeServiceAuraX11::UsingDefaultTheme() const { |
| 90 return ThemeService::UsingDefaultTheme() && !UsingSystemTheme(); | 90 return ThemeService::UsingDefaultTheme() && !UsingSystemTheme(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool ThemeServiceAuraX11::UsingSystemTheme() const { | 93 bool ThemeServiceAuraX11::UsingSystemTheme() const { |
| 94 const CustomThemeSupplier* theme_supplier = get_theme_supplier(); | 94 const CustomThemeSupplier* theme_supplier = get_theme_supplier(); |
| 95 return theme_supplier && | 95 return theme_supplier && |
| 96 theme_supplier->get_theme_type() == CustomThemeSupplier::NATIVE_X11; | 96 theme_supplier->get_theme_type() == CustomThemeSupplier::NATIVE_X11; |
| 97 } | 97 } |
| OLD | NEW |