Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
index 7434d9c7fff09403842d49496424ac332178f970..efdb84f868e66373ce3cdca9b0bd273d803bd4f2 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -810,15 +810,17 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(Browser* browser, |
} |
#if defined(USE_ASH) |
- // Set the browser's root window to be an active root window now so |
- // that that web contents can determine correct scale factor for the |
- // renderer. This is a short term fix for crbug.com/155201. Without |
- // this, the renderer may use wrong scale factor first, then |
- // switched to the correct scale factor, which can cause race |
- // condition and lead to the results rendered at wrong scale factor. |
- // Long term fix is tracked in crbug.com/15543. |
- ash::Shell::GetInstance()->set_active_root_window( |
- browser->window()->GetNativeWindow()->GetRootWindow()); |
+ if (ash::Shell::HasInstance()) { |
+ // Set the browser's root window to be an active root window now so |
+ // that that web contents can determine correct scale factor for the |
+ // renderer. This is a short term fix for crbug.com/155201. Without |
+ // this, the renderer may use wrong scale factor first, then |
+ // switched to the correct scale factor, which can cause race |
+ // condition and lead to the results rendered at wrong scale factor. |
+ // Long term fix is tracked in crbug.com/15543. |
+ ash::Shell::GetInstance()->set_active_root_window( |
+ browser->window()->GetNativeWindow()->GetRootWindow()); |
+ } |
#endif |
// In kiosk mode, we want to always be fullscreen, so switch to that now. |