| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 if (delegate_) { | 76 if (delegate_) { |
| 77 locale_file_path = | 77 locale_file_path = |
| 78 delegate_->GetPathForLocalePack(locale_file_path, app_locale); | 78 delegate_->GetPathForLocalePack(locale_file_path, app_locale); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Don't try to load empty values or values that are not absolute paths. | 81 // Don't try to load empty values or values that are not absolute paths. |
| 82 if (locale_file_path.empty() || !locale_file_path.IsAbsolute()) | 82 if (locale_file_path.empty() || !locale_file_path.IsAbsolute()) |
| 83 return base::FilePath(); | 83 return base::FilePath(); |
| 84 | 84 |
| 85 if (test_file_exists && !file_util::PathExists(locale_file_path)) | 85 if (test_file_exists && !base::PathExists(locale_file_path)) |
| 86 return base::FilePath(); | 86 return base::FilePath(); |
| 87 | 87 |
| 88 return locale_file_path; | 88 return locale_file_path; |
| 89 } | 89 } |
| 90 | 90 |
| 91 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { | 91 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { |
| 92 // Flipped images are not used on iOS. | 92 // Flipped images are not used on iOS. |
| 93 DCHECK_EQ(rtl, RTL_DISABLED); | 93 DCHECK_EQ(rtl, RTL_DISABLED); |
| 94 | 94 |
| 95 // Check to see if the image is already in the cache. | 95 // Check to see if the image is already in the cache. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 // Another thread raced the load and has already cached the image. | 181 // Another thread raced the load and has already cached the image. |
| 182 if (images_.count(resource_id)) | 182 if (images_.count(resource_id)) |
| 183 return images_[resource_id]; | 183 return images_[resource_id]; |
| 184 | 184 |
| 185 images_[resource_id] = image; | 185 images_[resource_id] = image; |
| 186 return images_[resource_id]; | 186 return images_[resource_id]; |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace ui | 189 } // namespace ui |
| OLD | NEW |