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

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

Issue 646773004: [iOS] Load chrome_300_percent.pak file on @3x devices. (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/resource_bundle.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (IsScaleFactorSupported(SCALE_FACTOR_100P)) { 47 if (IsScaleFactorSupported(SCALE_FACTOR_100P)) {
48 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent", nil), 48 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent", nil),
49 SCALE_FACTOR_100P); 49 SCALE_FACTOR_100P);
50 } 50 }
51 51
52 if (IsScaleFactorSupported(SCALE_FACTOR_200P)) { 52 if (IsScaleFactorSupported(SCALE_FACTOR_200P)) {
53 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent", nil), 53 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent", nil),
54 SCALE_FACTOR_200P); 54 SCALE_FACTOR_200P);
55 } 55 }
56 56
57 // TODO(rohitrao): Add a chrome_300_percent file and load it here. For now,
58 // we are simply falling back to the 200P resources. http://crbug.com/413300.
59 if (IsScaleFactorSupported(SCALE_FACTOR_300P)) { 57 if (IsScaleFactorSupported(SCALE_FACTOR_300P)) {
60 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_200_percent", nil), 58 AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_300_percent", nil),
61 SCALE_FACTOR_200P); 59 SCALE_FACTOR_300P);
62 } 60 }
63 } 61 }
64 62
65 base::FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale, 63 base::FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale,
66 bool test_file_exists) { 64 bool test_file_exists) {
67 NSString* mac_locale = base::SysUTF8ToNSString(app_locale); 65 NSString* mac_locale = base::SysUTF8ToNSString(app_locale);
68 66
69 // iOS uses "_" instead of "-", so swap to get a iOS-style value. 67 // iOS uses "_" instead of "-", so swap to get a iOS-style value.
70 mac_locale = [mac_locale stringByReplacingOccurrencesOfString:@"-" 68 mac_locale = [mac_locale stringByReplacingOccurrencesOfString:@"-"
71 withString:@"_"]; 69 withString:@"_"];
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 184
187 // Another thread raced the load and has already cached the image. 185 // Another thread raced the load and has already cached the image.
188 if (images_.count(resource_id)) 186 if (images_.count(resource_id))
189 return images_[resource_id]; 187 return images_[resource_id];
190 188
191 images_[resource_id] = image; 189 images_[resource_id] = image;
192 return images_[resource_id]; 190 return images_[resource_id];
193 } 191 }
194 192
195 } // namespace ui 193 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698