| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |