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> | 7 #include <limits> |
8 | 8 |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 ++it) { | 1487 ++it) { |
1488 (*destination)[it->first] = it->second; | 1488 (*destination)[it->first] = it->second; |
1489 } | 1489 } |
1490 } | 1490 } |
1491 | 1491 |
1492 void BrowserThemePack::AddRawImagesTo(const RawImages& images, | 1492 void BrowserThemePack::AddRawImagesTo(const RawImages& images, |
1493 RawDataForWriting* out) const { | 1493 RawDataForWriting* out) const { |
1494 for (RawImages::const_iterator it = images.begin(); it != images.end(); | 1494 for (RawImages::const_iterator it = images.begin(); it != images.end(); |
1495 ++it) { | 1495 ++it) { |
1496 (*out)[it->first] = base::StringPiece( | 1496 (*out)[it->first] = base::StringPiece( |
1497 reinterpret_cast<const char*>(it->second->front()), it->second->size()); | 1497 it->second->front_as<char>(), it->second->size()); |
1498 } | 1498 } |
1499 } | 1499 } |
1500 | 1500 |
1501 color_utils::HSL BrowserThemePack::GetTintInternal(int id) const { | 1501 color_utils::HSL BrowserThemePack::GetTintInternal(int id) const { |
1502 if (tints_) { | 1502 if (tints_) { |
1503 for (size_t i = 0; i < kTintTableLength; ++i) { | 1503 for (size_t i = 0; i < kTintTableLength; ++i) { |
1504 if (tints_[i].id == id) { | 1504 if (tints_[i].id == id) { |
1505 color_utils::HSL hsl; | 1505 color_utils::HSL hsl; |
1506 hsl.h = tints_[i].h; | 1506 hsl.h = tints_[i].h; |
1507 hsl.s = tints_[i].s; | 1507 hsl.s = tints_[i].s; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 false, | 1607 false, |
1608 &bitmap_data)) { | 1608 &bitmap_data)) { |
1609 NOTREACHED() << "Unable to encode theme image for prs_id=" | 1609 NOTREACHED() << "Unable to encode theme image for prs_id=" |
1610 << prs_id << " for scale_factor=" << scale_factors_[i]; | 1610 << prs_id << " for scale_factor=" << scale_factors_[i]; |
1611 break; | 1611 break; |
1612 } | 1612 } |
1613 image_memory_[scaled_raw_id] = | 1613 image_memory_[scaled_raw_id] = |
1614 base::RefCountedBytes::TakeVector(&bitmap_data); | 1614 base::RefCountedBytes::TakeVector(&bitmap_data); |
1615 } | 1615 } |
1616 } | 1616 } |
OLD | NEW |