Chromium Code Reviews| 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 "chrome/browser/themes/browser_theme_pack.h" | 5 #include "chrome/browser/themes/browser_theme_pack.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 783 } | 783 } |
| 784 | 784 |
| 785 return false; | 785 return false; |
| 786 } | 786 } |
| 787 | 787 |
| 788 bool BrowserThemePack::GetColor(int id, SkColor* color) const { | 788 bool BrowserThemePack::GetColor(int id, SkColor* color) const { |
| 789 if (colors_) { | 789 if (colors_) { |
| 790 for (size_t i = 0; i < kColorTableLength; ++i) { | 790 for (size_t i = 0; i < kColorTableLength; ++i) { |
| 791 if (colors_[i].id == id) { | 791 if (colors_[i].id == id) { |
| 792 *color = colors_[i].color; | 792 *color = colors_[i].color; |
| 793 // The theme provider is intentionally made to ignore the alpha value of | |
| 794 // toolbar color, see crbug.com/618278. | |
|
Peter Kasting
2016/07/01 21:03:14
Nit: Avoid referring to bugs in comments, and just
| |
| 795 if (id == ThemeProperties::COLOR_TOOLBAR) { | |
| 796 *color = SkColorSetARGB(SK_AlphaOPAQUE, SkColorGetR(*color), | |
| 797 SkColorGetG(*color), SkColorGetB(*color)); | |
|
Peter Kasting
2016/07/01 21:03:14
Nit: Just:
*color = SkColorSetA(*color, SK_Alph
| |
| 798 } | |
| 793 return true; | 799 return true; |
| 794 } | 800 } |
| 795 } | 801 } |
| 796 } | 802 } |
| 797 | 803 |
| 798 return false; | 804 return false; |
| 799 } | 805 } |
| 800 | 806 |
| 801 bool BrowserThemePack::GetDisplayProperty(int id, int* result) const { | 807 bool BrowserThemePack::GetDisplayProperty(int id, int* result) const { |
| 802 if (display_properties_) { | 808 if (display_properties_) { |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1537 false, | 1543 false, |
| 1538 &bitmap_data)) { | 1544 &bitmap_data)) { |
| 1539 NOTREACHED() << "Unable to encode theme image for prs_id=" | 1545 NOTREACHED() << "Unable to encode theme image for prs_id=" |
| 1540 << prs_id << " for scale_factor=" << scale_factors_[i]; | 1546 << prs_id << " for scale_factor=" << scale_factors_[i]; |
| 1541 break; | 1547 break; |
| 1542 } | 1548 } |
| 1543 image_memory_[scaled_raw_id] = | 1549 image_memory_[scaled_raw_id] = |
| 1544 base::RefCountedBytes::TakeVector(&bitmap_data); | 1550 base::RefCountedBytes::TakeVector(&bitmap_data); |
| 1545 } | 1551 } |
| 1546 } | 1552 } |
| OLD | NEW |