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

Side by Side Diff: ui/base/resource/resource_bundle_mac.mm

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 | « ui/base/resource/resource_bundle_gtk.cc ('k') | ui/base/resource/resource_bundle_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 "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return FilePath(base::SysNSStringToUTF8(name) + ".pak"); 43 return FilePath(base::SysNSStringToUTF8(name) + ".pak");
44 } 44 }
45 45
46 return FilePath([resource_path fileSystemRepresentation]); 46 return FilePath([resource_path fileSystemRepresentation]);
47 } 47 }
48 48
49 } // namespace 49 } // namespace
50 50
51 void ResourceBundle::LoadCommonResources() { 51 void ResourceBundle::LoadCommonResources() {
52 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome", nil), 52 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome", nil),
53 SCALE_FACTOR_100P); 53 SCALE_FACTOR_NONE);
54 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent", 54 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent",
55 nil), SCALE_FACTOR_100P); 55 nil), SCALE_FACTOR_100P);
56 AddDataPackFromPath(GetResourcesPakFilePath(@"webkit_resources_100_percent", 56 AddDataPackFromPath(GetResourcesPakFilePath(@"webkit_resources_100_percent",
57 nil), SCALE_FACTOR_100P); 57 nil), SCALE_FACTOR_100P);
58 58
59 // On Mac we load 1x and 2x resources and we let the UI framework decide 59 // On Mac we load 1x and 2x resources and we let the UI framework decide
60 // which one to use. 60 // which one to use.
61 if (IsScaleFactorSupported(SCALE_FACTOR_200P)) { 61 if (IsScaleFactorSupported(SCALE_FACTOR_200P)) {
62 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent", 62 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent",
63 nil), SCALE_FACTOR_200P); 63 nil), SCALE_FACTOR_200P);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 // Another thread raced the load and has already cached the image. 151 // Another thread raced the load and has already cached the image.
152 if (images_.count(resource_id)) 152 if (images_.count(resource_id))
153 return images_[resource_id]; 153 return images_[resource_id];
154 154
155 images_[resource_id] = image; 155 images_[resource_id] = image;
156 return images_[resource_id]; 156 return images_[resource_id];
157 } 157 }
158 158
159 } // namespace ui 159 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_gtk.cc ('k') | ui/base/resource/resource_bundle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698