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

Unified Diff: ui/views/mus/aura_init.cc

Issue 2377203005: services/shell: Allow injecting the location of resources.
Patch Set: Created 4 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 | « ui/views/mus/aura_init.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/aura_init.cc
diff --git a/ui/views/mus/aura_init.cc b/ui/views/mus/aura_init.cc
index 2d0981b9e1aaafa8790fadb890dec96ee9362e78..4543c269bc5344d938770aec38381baab1888211 100644
--- a/ui/views/mus/aura_init.cc
+++ b/ui/views/mus/aura_init.cc
@@ -74,17 +74,26 @@ void AuraInit::InitializeResources(shell::Connector* connector) {
if (ui::ResourceBundle::HasSharedInstance())
return;
+#if 0
std::set<std::string> resource_paths({resource_file_});
if (!resource_file_200_.empty())
resource_paths.insert(resource_file_200_);
+#else
+ std::set<std::string> resource_paths({
+ "chrome_100_percent.pak", "chrome_200_percent.pak", "resources.pak",
+ });
+#endif
+
+ resource_file_ = "chrome_100_percent.pak";
+ resource_file_200_ = "chrome_200_percent.pak";
catalog::ResourceLoader loader;
filesystem::mojom::DirectoryPtr directory;
connector->ConnectToInterface("mojo:catalog", &directory);
CHECK(loader.OpenFiles(std::move(directory), resource_paths));
ui::RegisterPathProvider();
- base::File pak_file = loader.TakeFile(resource_file_);
- base::File pak_file_2 = pak_file.Duplicate();
+ base::File pak_file = loader.TakeFile("resources.pak");
+ base::File pak_file_2 = loader.TakeFile("chrome_100_percent.pak");
ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile);
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
« no previous file with comments | « ui/views/mus/aura_init.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698