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

Unified Diff: chrome/app/mash/mash_runner.cc

Issue 2387233002: chrome/mash: Load resources before running the mus app. (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 | ui/views/mus/aura_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/mash/mash_runner.cc
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc
index e3c1c7334794ac989a4656479a79b2f1b63be7c5..ce61b736f65067deb581015ab8b41232e207574a 100644
--- a/chrome/app/mash/mash_runner.cc
+++ b/chrome/app/mash/mash_runner.cc
@@ -29,6 +29,9 @@
#include "services/shell/public/interfaces/service_factory.mojom.h"
#include "services/shell/runner/common/switches.h"
#include "services/shell/runner/host/child_process_base.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_paths.h"
+#include "ui/base/ui_base_switches.h"
using shell::mojom::ServiceFactory;
@@ -44,6 +47,16 @@ bool IsChild() {
switches::kProcessType) == kMashChild;
}
+void InitializeResources() {
+ ui::RegisterPathProvider();
+ const std::string locale =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kLang);
+ // This loads the Chrome's resources (chrome_100_percent.pak etc.)
+ ui::ResourceBundle::InitSharedInstanceWithLocale(
+ locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
+}
+
// Convert the command line program from chrome_mash to chrome. This is
// necessary as the shell will attempt to start chrome_mash. We want chrome.
void ChangeChromeMashToChrome(base::CommandLine* command_line) {
@@ -120,6 +133,7 @@ void MashRunner::RunMain() {
void MashRunner::RunChild() {
base::i18n::InitializeICU();
+ InitializeResources();
shell::ChildProcessMainWithCallback(
base::Bind(&MashRunner::StartChildApp, base::Unretained(this)));
}
« no previous file with comments | « no previous file | ui/views/mus/aura_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698