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