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

Unified Diff: chrome/browser/browser_theme_provider_mac.mm

Issue 499004: Try 2: Completely redo how themes are stored on disk and processed at install time. (Closed)
Patch Set: Created 11 years 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/browser_theme_provider_mac.mm
diff --git a/chrome/browser/browser_theme_provider_mac.mm b/chrome/browser/browser_theme_provider_mac.mm
index 65c2182ee23cc4962204a4c7a5d68182fdff5f14..ec3d4a8bcf83dc4b92c03072006c02046c0dffb5 100644
--- a/chrome/browser/browser_theme_provider_mac.mm
+++ b/chrome/browser/browser_theme_provider_mac.mm
@@ -8,6 +8,7 @@
#include "app/gfx/color_utils.h"
#include "base/logging.h"
+#include "chrome/browser/browser_theme_pack.h"
#include "skia/ext/skia_utils_mac.h"
namespace {
@@ -75,9 +76,8 @@ NSColor* BrowserThemeProvider::GetNSColor(int id) const {
if (nscolor_iter != nscolor_cache_.end())
return nscolor_iter->second;
- ColorMap::const_iterator color_iter = colors_.find(GetColorKey(id));
- if (color_iter != colors_.end()) {
- const SkColor& sk_color = color_iter->second;
+ SkColor sk_color;
+ if (theme_pack_.get() && theme_pack_->GetColor(id, &sk_color)) {
NSColor* color = [NSColor
colorWithCalibratedRed:SkColorGetR(sk_color)/255.0
green:SkColorGetG(sk_color)/255.0
@@ -102,9 +102,8 @@ NSColor* BrowserThemeProvider::GetNSColorTint(int id) const {
if (nscolor_iter != nscolor_cache_.end())
return nscolor_iter->second;
- TintMap::const_iterator tint_iter = tints_.find(GetTintKey(id));
- if (tint_iter != tints_.end()) {
- color_utils::HSL tint = tint_iter->second;
+ color_utils::HSL tint;
+ if (theme_pack_.get() && theme_pack_->GetTint(id, &tint)) {
CGFloat hue, saturation, brightness;
HSLToHSB(tint, &hue, &saturation, &brightness);

Powered by Google App Engine
This is Rietveld 408576698