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

Unified Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc

Issue 2818123002: Move LayoutProvider initialization to later in the startup process. (Closed)
Patch Set: Updated comments Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
index 556bd754b5435d347b193fd0119b59fb4bcf173c..b5486da2d5674d4a2886b4c6d77b7eeb0f4ec5f8 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -73,9 +73,6 @@ void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() {
if (!views::ViewsDelegate::GetInstance())
views_delegate_ = base::MakeUnique<ChromeViewsDelegate>();
- if (!views::LayoutProvider::Get())
- layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider();
-
SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient());
#if defined(USE_AURA)
@@ -90,6 +87,14 @@ void ChromeBrowserMainExtraPartsViews::PreCreateThreads() {
if (!display::Screen::GetScreen())
display::Screen::SetScreenInstance(views::CreateDesktopScreen());
#endif
+
+ // TODO(pkasting): Try to move ViewsDelegate creation here as well;
+ // see https://crbug.com/691894#c1
+ // The layout_provider_ must be intialized here instead of in
+ // ToolkitInitialized() because it relies on
+ // ui::MaterialDesignController::Intialize() having already been called.
+ if (!views::LayoutProvider::Get())
+ layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider();
}
void ChromeBrowserMainExtraPartsViews::PreProfileInit() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698