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

Side by Side Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 2044223006: Make toolbar color opaque in browser theme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failure Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/themes/browser_theme_pack_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 alpha for toolbar
794 // color, as we don't want to allow transparent toolbars.
795 if (id == ThemeProperties::COLOR_TOOLBAR)
796 *color = SkColorSetA(*color, SK_AlphaOPAQUE);
793 return true; 797 return true;
794 } 798 }
795 } 799 }
796 } 800 }
797 801
798 return false; 802 return false;
799 } 803 }
800 804
801 bool BrowserThemePack::GetDisplayProperty(int id, int* result) const { 805 bool BrowserThemePack::GetDisplayProperty(int id, int* result) const {
802 if (display_properties_) { 806 if (display_properties_) {
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 false, 1541 false,
1538 &bitmap_data)) { 1542 &bitmap_data)) {
1539 NOTREACHED() << "Unable to encode theme image for prs_id=" 1543 NOTREACHED() << "Unable to encode theme image for prs_id="
1540 << prs_id << " for scale_factor=" << scale_factors_[i]; 1544 << prs_id << " for scale_factor=" << scale_factors_[i];
1541 break; 1545 break;
1542 } 1546 }
1543 image_memory_[scaled_raw_id] = 1547 image_memory_[scaled_raw_id] =
1544 base::RefCountedBytes::TakeVector(&bitmap_data); 1548 base::RefCountedBytes::TakeVector(&bitmap_data);
1545 } 1549 }
1546 } 1550 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/themes/browser_theme_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698