| Index: ui/base/resource/resource_bundle.cc
|
| diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
|
| index 0f95c9e2e08dfdbeaa388cf67755dbdbc57ca9a6..1dc1acded0b0e37488b6750dd6268c45bb7691c2 100644
|
| --- a/ui/base/resource/resource_bundle.cc
|
| +++ b/ui/base/resource/resource_bundle.cc
|
| @@ -57,6 +57,8 @@
|
| #include "ui/display/win/dpi.h"
|
| #endif
|
|
|
| +// Helpers --------------------------------------------------------------------
|
| +
|
| namespace ui {
|
|
|
| namespace {
|
| @@ -114,6 +116,29 @@ SkBitmap CreateEmptyBitmap() {
|
|
|
| } // namespace
|
|
|
| +
|
| +// ResourceBundle::TemporaryLoader --------------------------------------------
|
| +
|
| +ResourceBundle::TemporaryLoader::TemporaryLoader()
|
| + : already_loaded_(ResourceBundle::HasSharedInstance()) {
|
| + if (!already_loaded_) {
|
| + std::string locale = l10n_util::GetApplicationLocale(std::string());
|
| + const char kUserDataDirDialogFallbackLocale[] = "en-US";
|
| + if (locale.empty())
|
| + locale = kUserDataDirDialogFallbackLocale;
|
| + ui::ResourceBundle::InitSharedInstanceWithLocale(
|
| + locale, nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
|
| + }
|
| +}
|
| +
|
| +ResourceBundle::TemporaryLoader::~TemporaryLoader() {
|
| + if (!already_loaded_)
|
| + ResourceBundle::CleanupSharedInstance();
|
| +}
|
| +
|
| +
|
| +// ResourceBundle::ResourceBundleImageSource ----------------------------------
|
| +
|
| // An ImageSkiaSource that loads bitmaps for the requested scale factor from
|
| // ResourceBundle on demand for a given |resource_id|. If the bitmap for the
|
| // requested scale factor does not exist, it will return the 1x bitmap scaled
|
| @@ -171,6 +196,9 @@ class ResourceBundle::ResourceBundleImageSource : public gfx::ImageSkiaSource {
|
| DISALLOW_COPY_AND_ASSIGN(ResourceBundleImageSource);
|
| };
|
|
|
| +
|
| +// ResourceBundle -------------------------------------------------------------
|
| +
|
| // static
|
| std::string ResourceBundle::InitSharedInstanceWithLocale(
|
| const std::string& pref_locale,
|
|
|