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

Unified Diff: ui/views/mus/aura_init.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 | « chrome/app/mash/mash_runner.cc ('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..3859d2f28318f91bf920968edd22219d253ba473 100644
--- a/ui/views/mus/aura_init.cc
+++ b/ui/views/mus/aura_init.cc
@@ -55,6 +55,16 @@ AuraInit::AuraInit(shell::Connector* connector,
ui::MaterialDesignController::Initialize();
InitializeResources(connector);
+// Initialize the skia font code to go ask fontconfig underneath.
+#if defined(OS_LINUX)
+ font_loader_ = sk_make_sp<font_service::FontLoader>(connector);
+ SkFontConfigInterface::SetGlobal(font_loader_.get());
+#endif
+
+ // There is a bunch of static state in gfx::Font, by running this now,
+ // before any other apps load, we ensure all the state is set up.
+ gfx::Font();
+
ui::InitializeInputMethodForTesting();
}
@@ -71,6 +81,8 @@ AuraInit::~AuraInit() {
}
void AuraInit::InitializeResources(shell::Connector* connector) {
+ // Resources may have already been initialized (e.g. when 'chrome --mash' is
+ // used to launch the current app).
if (ui::ResourceBundle::HasSharedInstance())
return;
@@ -92,16 +104,6 @@ void AuraInit::InitializeResources(shell::Connector* connector) {
if (!resource_file_200_.empty())
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P);
-
-// Initialize the skia font code to go ask fontconfig underneath.
-#if defined(OS_LINUX)
- font_loader_ = sk_make_sp<font_service::FontLoader>(connector);
- SkFontConfigInterface::SetGlobal(font_loader_.get());
-#endif
-
- // There is a bunch of static state in gfx::Font, by running this now,
- // before any other apps load, we ensure all the state is set up.
- gfx::Font();
}
} // namespace views
« no previous file with comments | « chrome/app/mash/mash_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698