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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 base::RefCountedMemory* memory = NULL; | 763 base::RefCountedMemory* memory = NULL; |
764 int prs_id = GetPersistentIDByIDR(idr_id); | 764 int prs_id = GetPersistentIDByIDR(idr_id); |
765 int raw_id = GetRawIDByPersistentID(prs_id, scale_factor); | 765 int raw_id = GetRawIDByPersistentID(prs_id, scale_factor); |
766 | 766 |
767 if (raw_id != -1) { | 767 if (raw_id != -1) { |
768 if (data_pack_.get()) { | 768 if (data_pack_.get()) { |
769 memory = data_pack_->GetStaticMemory(raw_id); | 769 memory = data_pack_->GetStaticMemory(raw_id); |
770 } else { | 770 } else { |
771 RawImages::const_iterator it = image_memory_.find(raw_id); | 771 RawImages::const_iterator it = image_memory_.find(raw_id); |
772 if (it != image_memory_.end()) { | 772 if (it != image_memory_.end()) { |
773 memory = it->second; | 773 memory = it->second.get(); |
774 } | 774 } |
775 } | 775 } |
776 } | 776 } |
777 | 777 |
778 return memory; | 778 return memory; |
779 } | 779 } |
780 | 780 |
781 // static | 781 // static |
782 void BrowserThemePack::GetThemeableImageIDRs(std::set<int>* result) { | 782 void BrowserThemePack::GetThemeableImageIDRs(std::set<int>* result) { |
783 if (!result) | 783 if (!result) |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 ui::ScaleFactor scale_factor) const { | 1354 ui::ScaleFactor scale_factor) const { |
1355 if (prs_id < 0) | 1355 if (prs_id < 0) |
1356 return -1; | 1356 return -1; |
1357 | 1357 |
1358 for (size_t i = 0; i < scale_factors_.size(); ++i) { | 1358 for (size_t i = 0; i < scale_factors_.size(); ++i) { |
1359 if (scale_factors_[i] == scale_factor) | 1359 if (scale_factors_[i] == scale_factor) |
1360 return static_cast<int>(kPersistingImagesLength * i) + prs_id; | 1360 return static_cast<int>(kPersistingImagesLength * i) + prs_id; |
1361 } | 1361 } |
1362 return -1; | 1362 return -1; |
1363 } | 1363 } |
OLD | NEW |