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 #include "ui/native_theme/native_theme.h" | 5 #include "ui/native_theme/native_theme.h" |
6 | 6 |
7 namespace ui { | 7 namespace ui { |
8 | 8 |
9 NativeThemeObserver::~NativeThemeObserver() {} | |
10 | |
9 void NativeTheme::SetScrollbarColors(unsigned inactive_color, | 11 void NativeTheme::SetScrollbarColors(unsigned inactive_color, |
10 unsigned active_color, | 12 unsigned active_color, |
11 unsigned track_color) { | 13 unsigned track_color) { |
12 thumb_inactive_color_ = inactive_color; | 14 thumb_inactive_color_ = inactive_color; |
13 thumb_active_color_ = active_color; | 15 thumb_active_color_ = active_color; |
14 track_color_ = track_color; | 16 track_color_ = track_color; |
15 } | 17 } |
16 | 18 |
17 // NativeTheme::instance() is implemented in the platform specific source files, | 19 // NativeTheme::instance() is implemented in the platform specific source files, |
18 // such as native_theme_win.cc or native_theme_linux.cc | 20 // such as native_theme_win.cc or native_theme_linux.cc |
19 | 21 |
22 void NativeTheme::AddObserver(NativeThemeObserver* observer) { | |
23 native_theme_observers_.AddObserver(observer); | |
24 } | |
25 | |
26 void NativeTheme::RemoveObserver(NativeThemeObserver* observer) { | |
27 native_theme_observers_.RemoveObserver(observer); | |
28 } | |
29 | |
30 void NativeTheme::OnNativeThemeChange() { | |
31 FOR_EACH_OBSERVER(NativeThemeObserver, native_theme_observers_, | |
32 OnNativeThemeChange()); | |
33 } | |
34 | |
20 NativeTheme::NativeTheme() | 35 NativeTheme::NativeTheme() |
21 : thumb_inactive_color_(0xeaeaea), | 36 : thumb_inactive_color_(0xeaeaea), |
22 thumb_active_color_(0xf4f4f4), | 37 thumb_active_color_(0xf4f4f4), |
23 track_color_(0xd3d3d3) { | 38 track_color_(0xd3d3d3), |
39 color_change_listener_(this) { | |
24 } | 40 } |
25 | 41 |
26 NativeTheme::~NativeTheme() {} | 42 NativeTheme::~NativeTheme() {} |
27 | 43 |
44 void NativeTheme::OnSysColorChange() { | |
45 OnNativeThemeChange(); | |
Evan Stade
2014/04/22 17:43:44
The native theme won't always change just because
msw
2014/04/22 19:48:58
Sadly, I'd have to do this for NativeThemeWin and
Evan Stade
2014/04/22 21:09:18
I don't mind that you'd have to do this in more th
msw
2014/04/23 00:34:04
I moved this over to NativeThemeWin; the observati
| |
46 } | |
47 | |
28 } // namespace ui | 48 } // namespace ui |
OLD | NEW |