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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 new DataPack(scale_factor)); | 200 new DataPack(scale_factor)); |
201 if (data_pack->LoadFromFile(file)) { | 201 if (data_pack->LoadFromFile(file)) { |
202 AddDataPack(data_pack.release()); | 202 AddDataPack(data_pack.release()); |
203 } else { | 203 } else { |
204 LOG(ERROR) << "Failed to load data pack from file." | 204 LOG(ERROR) << "Failed to load data pack from file." |
205 << "\nSome features may not be available."; | 205 << "\nSome features may not be available."; |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 #if !defined(OS_MACOSX) | 209 #if !defined(OS_MACOSX) |
210 FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale, | 210 base::FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale, |
211 bool test_file_exists) { | 211 bool test_file_exists) { |
212 if (app_locale.empty()) | 212 if (app_locale.empty()) |
213 return base::FilePath(); | 213 return base::FilePath(); |
214 | 214 |
215 base::FilePath locale_file_path; | 215 base::FilePath locale_file_path; |
216 | 216 |
217 PathService::Get(ui::DIR_LOCALES, &locale_file_path); | 217 PathService::Get(ui::DIR_LOCALES, &locale_file_path); |
218 | 218 |
219 if (!locale_file_path.empty()) | 219 if (!locale_file_path.empty()) |
220 locale_file_path = locale_file_path.AppendASCII(app_locale + ".pak"); | 220 locale_file_path = locale_file_path.AppendASCII(app_locale + ".pak"); |
221 | 221 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 // static | 710 // static |
711 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 711 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
712 size_t size, | 712 size_t size, |
713 SkBitmap* bitmap, | 713 SkBitmap* bitmap, |
714 bool* fell_back_to_1x) { | 714 bool* fell_back_to_1x) { |
715 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 715 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
716 return gfx::PNGCodec::Decode(buf, size, bitmap); | 716 return gfx::PNGCodec::Decode(buf, size, bitmap); |
717 } | 717 } |
718 | 718 |
719 } // namespace ui | 719 } // namespace ui |
OLD | NEW |