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

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

Issue 611103002: Clean up pak loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « ui/base/resource/data_pack_literal.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 26 matching lines...) Expand all
37 if (!resource_path) { 37 if (!resource_path) {
38 // Return just the name of the pak file. 38 // Return just the name of the pak file.
39 return base::FilePath(base::SysNSStringToUTF8(name) + ".pak"); 39 return base::FilePath(base::SysNSStringToUTF8(name) + ".pak");
40 } 40 }
41 return base::FilePath([resource_path fileSystemRepresentation]); 41 return base::FilePath([resource_path fileSystemRepresentation]);
42 } 42 }
43 43
44 } // namespace 44 } // namespace
45 45
46 void ResourceBundle::LoadCommonResources() { 46 void ResourceBundle::LoadCommonResources() {
47 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome", nil),
48 ui::SCALE_FACTOR_NONE);
49
50 if (IsScaleFactorSupported(SCALE_FACTOR_100P)) { 47 if (IsScaleFactorSupported(SCALE_FACTOR_100P)) {
51 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent", nil), 48 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent", nil),
52 SCALE_FACTOR_100P); 49 SCALE_FACTOR_100P);
53 } 50 }
54 51
55 if (IsScaleFactorSupported(SCALE_FACTOR_200P)) { 52 if (IsScaleFactorSupported(SCALE_FACTOR_200P)) {
56 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent", nil), 53 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent", nil),
57 SCALE_FACTOR_200P); 54 SCALE_FACTOR_200P);
58 } 55 }
59 56
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 186
190 // Another thread raced the load and has already cached the image. 187 // Another thread raced the load and has already cached the image.
191 if (images_.count(resource_id)) 188 if (images_.count(resource_id))
192 return images_[resource_id]; 189 return images_[resource_id];
193 190
194 images_[resource_id] = image; 191 images_[resource_id] = image;
195 return images_[resource_id]; 192 return images_[resource_id];
196 } 193 }
197 194
198 } // namespace ui 195 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/data_pack_literal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698