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

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

Issue 564473002: Makes loading test resources load the first supported scale factor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.cc
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index d7e7411ca007971457bb57d53ba033987c1a87aa..f09b999fa82cd75fecefbffb0b436fc073e65a8d 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -321,8 +321,10 @@ std::string ResourceBundle::LoadLocaleResources(
void ResourceBundle::LoadTestResources(const base::FilePath& path,
const base::FilePath& locale_path) {
+ DCHECK(!ui::GetSupportedScaleFactors().empty());
+ const ScaleFactor scale_factor(ui::GetSupportedScaleFactors()[0]);
// Use the given resource pak for both common and localized resources.
- scoped_ptr<DataPack> data_pack(new DataPack(SCALE_FACTOR_100P));
+ scoped_ptr<DataPack> data_pack(new DataPack(scale_factor));
if (!path.empty() && data_pack->LoadFromPath(path))
AddDataPack(data_pack.release());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698