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

Unified Diff: chrome/browser/themes/theme_service.h

Issue 1744483002: Monitor the system native frame color on Win 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/themes/theme_service.cc » ('j') | chrome/browser/themes/theme_service.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_service.h
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index cabfefe2954c635e862f81c3021ee44ca51c20e8..7f2aae589f708324e1efcabd087a072dd21dd5a4 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -22,6 +22,10 @@
#include "content/public/browser/notification_registrar.h"
#include "ui/base/theme_provider.h"
+#if defined(OS_WIN)
+#include "base/win/registry.h"
+#endif
+
class CustomThemeSupplier;
class BrowserThemePack;
class ThemeSyncableService;
@@ -259,6 +263,16 @@ class ThemeService : public base::NonThreadSafe,
void SetSupervisedUserTheme();
#endif
+#if defined(OS_WIN)
+ // Returns true if the window frame color is determined by the DWM, i.e. this
+ // is a native frame on Win 10+.
+ bool ShouldUseDwmFrameColor() const;
+
+ // Callback executed when |dwm_key_| is updated. This re-reads the active
+ // frame color and updates |dwm_frame_color_|.
+ void OnDwmKeyUpdated();
+#endif
+
#if defined(OS_MACOSX)
// |nsimage_cache_| retains the images it has cached.
typedef std::map<int, NSImage*> NSImageMap;
@@ -287,6 +301,15 @@ class ThemeService : public base::NonThreadSafe,
// The number of infobars currently displayed.
int number_of_infobars_;
+#if defined(OS_WIN)
+ // Registry key containing the params that determine the DWM frame color.
+ // This is only initialized on Windows 10.
+ scoped_ptr<base::win::RegKey> dwm_key_;
+
+ // The DWM frame color, if available; white otherwise.
+ SkColor dwm_frame_color_;
+#endif
+
content::NotificationRegistrar registrar_;
scoped_ptr<ThemeSyncableService> theme_syncable_service_;
« no previous file with comments | « no previous file | chrome/browser/themes/theme_service.cc » ('j') | chrome/browser/themes/theme_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698