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

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

Issue 1785613004: Dynamically compute tab/frame separator color. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: chrome/browser/themes/theme_service.h
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index 7f4cf1e8f074ada397a488bab476f4f03260a51f..d9423f9ab276d23f172f17b0a39984b21763e500 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -215,6 +215,10 @@ class ThemeService : public base::NonThreadSafe,
friend class BrowserThemeProvider;
friend class theme_service_internal::ThemeServiceTest;
+ // Key for cache of separator colors; pair is <tab color, frame color>.
+ using SeparatorColorKey = std::pair<SkColor, SkColor>;
+ using SeparatorColorCache = std::map<SeparatorColorKey, SkColor>;
+
// These methods provide the implementation for ui::ThemeProvider (exposed
// via BrowserThemeProvider).
gfx::ImageSkia* GetImageSkiaNamed(int id, bool incognito) const;
@@ -295,6 +299,10 @@ class ThemeService : public base::NonThreadSafe,
// The number of infobars currently displayed.
int number_of_infobars_;
+ // A cache of already-computed values for COLOR_TOOLBAR_TOP_SEPARATOR, which
+ // can be expensive to compute.
+ mutable SeparatorColorCache separator_color_cache_;
+
content::NotificationRegistrar registrar_;
scoped_ptr<ThemeSyncableService> theme_syncable_service_;

Powered by Google App Engine
This is Rietveld 408576698