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

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') | ui/views/mus/aura_init.cc » ('J')
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..bc21a6acee2228010f4c198fb8531ca27f05b7bb 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,15 @@ bool IsChild() {
switches::kProcessType) == kMashChild;
}
+void InitializeResources() {
+ ui::RegisterPathProvider();
+ const std::string locale =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kLang);
+ ui::ResourceBundle::InitSharedInstanceWithLocale(
msw 2016/10/03 22:07:39 nit: add a comment that this loads Chrome's resour
sadrul 2016/10/04 00:42:48 Done.
+ locale, NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
sky 2016/10/03 22:17:17 nullptr
sadrul 2016/10/04 00:42:48 Done.
+}
+
// 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 +132,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') | ui/views/mus/aura_init.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698