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

Unified Diff: ash/sysui/sysui_application.cc

Issue 2148363003: mash: Cleanup ash test strings and resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup patch Created 4 years, 5 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 | « ash/sysui/BUILD.gn ('k') | ash/test/test_suite.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/sysui/sysui_application.cc
diff --git a/ash/sysui/sysui_application.cc b/ash/sysui/sysui_application.cc
index 61e1b9a3d04952b7ae71508e84d22a7c6245803a..8c2058631f481a6d22305426bee43e7ba00baf7b 100644
--- a/ash/sysui/sysui_application.cc
+++ b/ash/sysui/sysui_application.cc
@@ -59,9 +59,9 @@ namespace sysui {
namespace {
-const char kResourceFileStrings[] = "ash_resources_strings.pak";
-const char kResourceFile100[] = "ash_resources_100_percent.pak";
-const char kResourceFile200[] = "ash_resources_200_percent.pak";
+const char kResourceFileStrings[] = "ash_test_strings.pak";
+const char kResourceFile100[] = "ash_test_resources_100_percent.pak";
+const char kResourceFile200[] = "ash_test_resources_200_percent.pak";
// Tries to determine the corresponding mash container from widget init params.
bool GetContainerForWidget(const views::Widget::InitParams& params,
@@ -266,16 +266,19 @@ class AshInit {
connector->ConnectToInterface("mojo:catalog", &directory);
CHECK(loader.OpenFiles(std::move(directory), resource_paths));
- // Load ash resources and en-US strings; not 'common' (Chrome) resources.
- // TODO(msw): Check ResourceBundle::IsScaleFactorSupported; load 300% etc.
+ // Load ash resources and strings; not 'common' (Chrome) resources.
ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
loader.TakeFile(kResourceFileStrings),
base::MemoryMappedFile::Region::kWholeFile);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- rb.AddDataPackFromFile(loader.TakeFile(kResourceFile100),
- ui::SCALE_FACTOR_100P);
- rb.AddDataPackFromFile(loader.TakeFile(kResourceFile200),
- ui::SCALE_FACTOR_200P);
+ if (ui::ResourceBundle::IsScaleFactorSupported(ui::SCALE_FACTOR_100P)) {
+ rb.AddDataPackFromFile(loader.TakeFile(kResourceFile100),
+ ui::SCALE_FACTOR_100P);
+ }
+ if (ui::ResourceBundle::IsScaleFactorSupported(ui::SCALE_FACTOR_200P)) {
+ rb.AddDataPackFromFile(loader.TakeFile(kResourceFile200),
+ ui::SCALE_FACTOR_200P);
+ }
}
void InitializeComponents() {
« no previous file with comments | « ash/sysui/BUILD.gn ('k') | ash/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698