| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_WIN_H_ | |
| 6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_WIN_H_ | |
| 7 | |
| 8 #include "base/win/registry.h" | |
| 9 #include "chrome/browser/themes/theme_service.h" | |
| 10 | |
| 11 class ThemeServiceWin : public ThemeService { | |
| 12 public: | |
| 13 ThemeServiceWin(); | |
| 14 ~ThemeServiceWin() override; | |
| 15 | |
| 16 private: | |
| 17 // ThemeService: | |
| 18 bool ShouldUseNativeFrame() const override; | |
| 19 SkColor GetDefaultColor(int id, bool incognito) const override; | |
| 20 | |
| 21 // Returns true if the window frame color is determined by the DWM, i.e. this | |
| 22 // is a native frame on Windows 10. | |
| 23 bool ShouldUseDwmFrameColor() const; | |
| 24 | |
| 25 // Callback executed when |dwm_key_| is updated. This re-reads the active | |
| 26 // frame color and updates |dwm_frame_color_|. | |
| 27 void OnDwmKeyUpdated(); | |
| 28 | |
| 29 // Registry key containing the params that determine the DWM frame color. | |
| 30 // This is only initialized on Windows 10. | |
| 31 scoped_ptr<base::win::RegKey> dwm_key_; | |
| 32 | |
| 33 // The DWM frame color, if available; white otherwise. | |
| 34 SkColor dwm_frame_color_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(ThemeServiceWin); | |
| 37 }; | |
| 38 | |
| 39 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_WIN_H_ | |
| OLD | NEW |