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

Side by Side Diff: ui/base/resource/resource_bundle.cc

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 | « third_party/zlib/google/zip_unittest.cc ('k') | ui/base/resource/resource_bundle_ios.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 (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 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 if (delegate_) { 218 if (delegate_) {
219 locale_file_path = 219 locale_file_path =
220 delegate_->GetPathForLocalePack(locale_file_path, app_locale); 220 delegate_->GetPathForLocalePack(locale_file_path, app_locale);
221 } 221 }
222 222
223 // Don't try to load empty values or values that are not absolute paths. 223 // Don't try to load empty values or values that are not absolute paths.
224 if (locale_file_path.empty() || !locale_file_path.IsAbsolute()) 224 if (locale_file_path.empty() || !locale_file_path.IsAbsolute())
225 return base::FilePath(); 225 return base::FilePath();
226 226
227 if (test_file_exists && !file_util::PathExists(locale_file_path)) 227 if (test_file_exists && !base::PathExists(locale_file_path))
228 return base::FilePath(); 228 return base::FilePath();
229 229
230 return locale_file_path; 230 return locale_file_path;
231 } 231 }
232 #endif 232 #endif
233 233
234 std::string ResourceBundle::LoadLocaleResources( 234 std::string ResourceBundle::LoadLocaleResources(
235 const std::string& pref_locale) { 235 const std::string& pref_locale) {
236 DCHECK(!locale_resources_data_.get()) << "locale.pak already loaded"; 236 DCHECK(!locale_resources_data_.get()) << "locale.pak already loaded";
237 std::string app_locale = l10n_util::GetApplicationLocale(pref_locale); 237 std::string app_locale = l10n_util::GetApplicationLocale(pref_locale);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // static 706 // static
707 bool ResourceBundle::DecodePNG(const unsigned char* buf, 707 bool ResourceBundle::DecodePNG(const unsigned char* buf,
708 size_t size, 708 size_t size,
709 SkBitmap* bitmap, 709 SkBitmap* bitmap,
710 bool* fell_back_to_1x) { 710 bool* fell_back_to_1x) {
711 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 711 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
712 return gfx::PNGCodec::Decode(buf, size, bitmap); 712 return gfx::PNGCodec::Decode(buf, size, bitmap);
713 } 713 }
714 714
715 } // namespace ui 715 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/zlib/google/zip_unittest.cc ('k') | ui/base/resource/resource_bundle_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698