Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 015317996270e81c314c9731b00f44d4c33f1059..3478844b7082267ef56b100bca7fc3c69eac8b1d 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -115,6 +115,7 @@ |
#if defined(USE_X11) |
#include "ui/gfx/x/x11_connection.h" |
+#include "ui/gfx/x/x11_types.h" |
#endif |
#if defined(USE_OZONE) |
@@ -1023,7 +1024,7 @@ int BrowserMainLoop::BrowserThreadsStarted() { |
return result_code_; |
} |
-void BrowserMainLoop::InitializeToolkit() { |
+bool BrowserMainLoop::InitializeToolkit() { |
TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit") |
// TODO(evan): this function is rather subtle, due to the variety |
// of intersecting ifdefs we have. To keep it easy to follow, there |
@@ -1048,13 +1049,21 @@ void BrowserMainLoop::InitializeToolkit() { |
#endif |
#if defined(USE_AURA) |
+ |
+#if defined(USE_X11) |
+ if (!gfx::GetXDisplay()) |
+ return false; |
+#endif |
+ |
// Env creates the compositor. Aura widgets need the compositor to be created |
// before they can be initialized by the browser. |
aura::Env::CreateInstance(); |
-#endif |
+#endif // defined(USE_AURA) |
if (parts_) |
parts_->ToolkitInitialized(); |
+ |
+ return true; |
} |
void BrowserMainLoop::MainMessageLoopRun() { |