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

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 1955773002: Enable MD by default on Windows for Canary/Dev and local builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't break first run Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
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..b59694d6c5648843e84523d66d102dad09d089c5 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,26 @@ SkBitmap CreateEmptyBitmap() {
} // namespace
+
+// ResourceBundle::TemporaryLoader --------------------------------------------
+
+ResourceBundle::TemporaryLoader::TemporaryLoader() {
+ DCHECK(!ResourceBundle::HasSharedInstance());
+ std::string locale = l10n_util::GetApplicationLocale(std::string());
+ const char kUserDataDirDialogFallbackLocale[] = "en-US";
+ if (locale.empty())
+ locale = kUserDataDirDialogFallbackLocale;
+ ui::ResourceBundle::InitSharedInstanceWithLocale(
+ locale, NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
sky 2016/05/13 15:49:56 nullptr
Peter Kasting 2016/05/16 19:53:16 Done.
+}
+
+ResourceBundle::TemporaryLoader::~TemporaryLoader() {
+ 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 +193,9 @@ class ResourceBundle::ResourceBundleImageSource : public gfx::ImageSkiaSource {
DISALLOW_COPY_AND_ASSIGN(ResourceBundleImageSource);
};
+
+// ResourceBundle -------------------------------------------------------------
+
// static
std::string ResourceBundle::InitSharedInstanceWithLocale(
const std::string& pref_locale,
« ui/base/material_design/material_design_controller.h ('K') | « ui/base/resource/resource_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698