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

Side by Side Diff: ui/base/resource/resource_bundle_mac.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_ios.mm ('k') | ui/base/ui_base_paths.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 if (delegate_) { 84 if (delegate_) {
85 locale_file_path = 85 locale_file_path =
86 delegate_->GetPathForLocalePack(locale_file_path, app_locale); 86 delegate_->GetPathForLocalePack(locale_file_path, app_locale);
87 } 87 }
88 88
89 // Don't try to load empty values or values that are not absolute paths. 89 // Don't try to load empty values or values that are not absolute paths.
90 if (locale_file_path.empty() || !locale_file_path.IsAbsolute()) 90 if (locale_file_path.empty() || !locale_file_path.IsAbsolute())
91 return base::FilePath(); 91 return base::FilePath();
92 92
93 if (test_file_exists && !file_util::PathExists(locale_file_path)) 93 if (test_file_exists && !base::PathExists(locale_file_path))
94 return base::FilePath(); 94 return base::FilePath();
95 95
96 return locale_file_path; 96 return locale_file_path;
97 } 97 }
98 98
99 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { 99 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
100 // Flipped images are not used on Mac. 100 // Flipped images are not used on Mac.
101 DCHECK_EQ(rtl, RTL_DISABLED); 101 DCHECK_EQ(rtl, RTL_DISABLED);
102 102
103 // Check to see if the image is already in the cache. 103 // Check to see if the image is already in the cache.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 // Another thread raced the load and has already cached the image. 151 // Another thread raced the load and has already cached the image.
152 if (images_.count(resource_id)) 152 if (images_.count(resource_id))
153 return images_[resource_id]; 153 return images_[resource_id];
154 154
155 images_[resource_id] = image; 155 images_[resource_id] = image;
156 return images_[resource_id]; 156 return images_[resource_id];
157 } 157 }
158 158
159 } // namespace ui 159 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_ios.mm ('k') | ui/base/ui_base_paths.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698