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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 11301007: Load the resources for max scale factor first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ash/shell/window_watcher.cc ('k') | chrome/browser/ui/webui/favicon_source.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/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
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 }
OLDNEW
« no previous file with comments | « ash/shell/window_watcher.cc ('k') | chrome/browser/ui/webui/favicon_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698