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

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

Issue 2406763002: In test code, allow any 100% data pack to provide fallbacks. (Closed)
Patch Set: Created 4 years, 2 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 899a8a45cb95aaf05737504cde5e9780fdf25afd..d5942fdfb5984056ef22e43321bbeb4d98ddfb96 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -830,7 +830,11 @@ bool ResourceBundle::LoadBitmap(int resource_id,
*scale_factor = ui::SCALE_FACTOR_NONE;
return true;
}
- if (data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_100P)
+
+ // There may be multiple SCALE_FACTOR_100P providers, assume only the first
+ // may provide test fallbacks.
oshima 2016/10/12 04:22:25 if this is for tets, can you also check is_test_re
tapted 2016/10/20 05:01:13 Done. Actually, separated out the `is_test_resourc
+ if (!data_handle_100_percent &&
+ data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_100P)
data_handle_100_percent = data_packs_[i];
if (data_packs_[i]->GetScaleFactor() == *scale_factor &&
« 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