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

Side by Side Diff: chrome/browser/themes/theme_service_aurax11.cc

Issue 23922007: Merge the LinuxUI interface from its own .so into libviews.so. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 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/linux_ui/linux_ui.h" 13 #include "ui/views/linux_ui/linux_ui.h"
14 14
15 namespace { 15 namespace {
16 16
17 class NativeThemeX11 : public CustomThemeSupplier { 17 class NativeThemeX11 : public CustomThemeSupplier {
18 public: 18 public:
19 explicit NativeThemeX11(PrefService* pref_service); 19 explicit NativeThemeX11(PrefService* pref_service);
20 20
21 // Overridden from CustomThemeSupplier: 21 // Overridden from CustomThemeSupplier:
22 virtual void StartUsingTheme() OVERRIDE; 22 virtual void StartUsingTheme() OVERRIDE;
23 virtual void StopUsingTheme() OVERRIDE; 23 virtual void StopUsingTheme() OVERRIDE;
24 virtual bool GetColor(int id, SkColor* color) const OVERRIDE; 24 virtual bool GetColor(int id, SkColor* color) const OVERRIDE;
25 virtual gfx::Image GetImageNamed(int id) OVERRIDE; 25 virtual gfx::Image GetImageNamed(int id) OVERRIDE;
26 virtual bool HasCustomImage(int id) const OVERRIDE; 26 virtual bool HasCustomImage(int id) const OVERRIDE;
27 27
28 private: 28 private:
29 virtual ~NativeThemeX11(); 29 virtual ~NativeThemeX11();
30 30
31 // These pointers are not owned by us. 31 // These pointers are not owned by us.
32 const ui::LinuxUI* const linux_ui_; 32 const views::LinuxUI* const linux_ui_;
33 PrefService* const pref_service_; 33 PrefService* const pref_service_;
34 34
35 DISALLOW_COPY_AND_ASSIGN(NativeThemeX11); 35 DISALLOW_COPY_AND_ASSIGN(NativeThemeX11);
36 }; 36 };
37 37
38 NativeThemeX11::NativeThemeX11(PrefService* pref_service) 38 NativeThemeX11::NativeThemeX11(PrefService* pref_service)
39 : CustomThemeSupplier(NATIVE_X11), 39 : CustomThemeSupplier(NATIVE_X11),
40 linux_ui_(ui::LinuxUI::instance()), 40 linux_ui_(views::LinuxUI::instance()),
41 pref_service_(pref_service) {} 41 pref_service_(pref_service) {}
42 42
43 void NativeThemeX11::StartUsingTheme() { 43 void NativeThemeX11::StartUsingTheme() {
44 pref_service_->SetBoolean(prefs::kUsesSystemTheme, true); 44 pref_service_->SetBoolean(prefs::kUsesSystemTheme, true);
45 } 45 }
46 46
47 void NativeThemeX11::StopUsingTheme() { 47 void NativeThemeX11::StopUsingTheme() {
48 pref_service_->SetBoolean(prefs::kUsesSystemTheme, false); 48 pref_service_->SetBoolean(prefs::kUsesSystemTheme, false);
49 } 49 }
50 50
(...skipping 27 matching lines...) Expand all
78 78
79 bool ThemeServiceAuraX11::UsingDefaultTheme() const { 79 bool ThemeServiceAuraX11::UsingDefaultTheme() const {
80 return ThemeService::UsingDefaultTheme() && !UsingNativeTheme(); 80 return ThemeService::UsingDefaultTheme() && !UsingNativeTheme();
81 } 81 }
82 82
83 bool ThemeServiceAuraX11::UsingNativeTheme() const { 83 bool ThemeServiceAuraX11::UsingNativeTheme() const {
84 const CustomThemeSupplier* theme_supplier = get_theme_supplier(); 84 const CustomThemeSupplier* theme_supplier = get_theme_supplier();
85 return theme_supplier && 85 return theme_supplier &&
86 theme_supplier->get_theme_type() == CustomThemeSupplier::NATIVE_X11; 86 theme_supplier->get_theme_type() == CustomThemeSupplier::NATIVE_X11;
87 } 87 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_status_updater.cc ('k') | chrome/browser/themes/theme_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698