| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 #if !defined(OS_MACOSX) | 196 #if !defined(OS_MACOSX) |
| 197 FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale, | 197 FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale, |
| 198 bool test_file_exists) { | 198 bool test_file_exists) { |
| 199 if (app_locale.empty()) | 199 if (app_locale.empty()) |
| 200 return FilePath(); | 200 return FilePath(); |
| 201 | 201 |
| 202 FilePath locale_file_path; | 202 FilePath locale_file_path; |
| 203 | 203 |
| 204 #if defined(OS_ANDROID) | |
| 205 PathService::Get(base::DIR_ANDROID_APP_DATA, &locale_file_path); | |
| 206 locale_file_path = locale_file_path.Append(FILE_PATH_LITERAL("paks")); | |
| 207 #else | |
| 208 PathService::Get(ui::DIR_LOCALES, &locale_file_path); | 204 PathService::Get(ui::DIR_LOCALES, &locale_file_path); |
| 209 #endif | |
| 210 | 205 |
| 211 if (!locale_file_path.empty()) | 206 if (!locale_file_path.empty()) |
| 212 locale_file_path = locale_file_path.AppendASCII(app_locale + ".pak"); | 207 locale_file_path = locale_file_path.AppendASCII(app_locale + ".pak"); |
| 213 | 208 |
| 214 if (delegate_) { | 209 if (delegate_) { |
| 215 locale_file_path = | 210 locale_file_path = |
| 216 delegate_->GetPathForLocalePack(locale_file_path, app_locale); | 211 delegate_->GetPathForLocalePack(locale_file_path, app_locale); |
| 217 } | 212 } |
| 218 | 213 |
| 219 // Don't try to load empty values or values that are not absolute paths. | 214 // Don't try to load empty values or values that are not absolute paths. |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 SkBitmap bitmap; | 572 SkBitmap bitmap; |
| 578 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 32, 32); | 573 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 32, 32); |
| 579 bitmap.allocPixels(); | 574 bitmap.allocPixels(); |
| 580 bitmap.eraseARGB(255, 255, 0, 0); | 575 bitmap.eraseARGB(255, 255, 0, 0); |
| 581 empty_image_ = gfx::Image(bitmap); | 576 empty_image_ = gfx::Image(bitmap); |
| 582 } | 577 } |
| 583 return empty_image_; | 578 return empty_image_; |
| 584 } | 579 } |
| 585 | 580 |
| 586 } // namespace ui | 581 } // namespace ui |
| OLD | NEW |