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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/base/resource/resource_bundle_mac.mm » ('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 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
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
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
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/base/resource/resource_bundle_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698