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/ui/views/tabs/tab.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 return i->image; | 840 return i->image; |
841 } | 841 } |
842 } | 842 } |
843 return gfx::ImageSkia(); | 843 return gfx::ImageSkia(); |
844 } | 844 } |
845 | 845 |
846 // static | 846 // static |
847 void Tab::SetCachedImage(int resource_id, | 847 void Tab::SetCachedImage(int resource_id, |
848 ui::ScaleFactor scale_factor, | 848 ui::ScaleFactor scale_factor, |
849 const gfx::ImageSkia& image) { | 849 const gfx::ImageSkia& image) { |
| 850 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
850 ImageCacheEntry entry; | 851 ImageCacheEntry entry; |
851 entry.resource_id = resource_id; | 852 entry.resource_id = resource_id; |
852 entry.scale_factor = scale_factor; | 853 entry.scale_factor = scale_factor; |
853 entry.image = image; | 854 entry.image = image; |
854 image_cache_->push_front(entry); | 855 image_cache_->push_front(entry); |
855 if (image_cache_->size() > kMaxImageCacheSize) | 856 if (image_cache_->size() > kMaxImageCacheSize) |
856 image_cache_->pop_back(); | 857 image_cache_->pop_back(); |
857 } | 858 } |
OLD | NEW |