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

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

Issue 23291003: Don't try to use compositor to display dialog before compositor is initialized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactor to avoid copying Created 7 years, 4 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 | chrome/browser/ui/views/simple_message_box_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/simple_message_box_views.cc
diff --git a/chrome/browser/ui/views/simple_message_box_views.cc b/chrome/browser/ui/views/simple_message_box_views.cc
index cc6211df372d6dd9b458c1467dc8570c52d91417..8d75c98d365dfeec95b5cc3a91b01234a5f9be6c 100644
--- a/chrome/browser/ui/views/simple_message_box_views.cc
+++ b/chrome/browser/ui/views/simple_message_box_views.cc
@@ -22,6 +22,9 @@
#include "ui/aura/client/dispatcher_client.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
+#if defined(OS_WIN)
+#include "chrome/browser/ui/views/simple_message_box_win.h"
+#endif
#endif
namespace chrome {
@@ -174,6 +177,13 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
const string16& title,
const string16& message,
MessageBoxType type) {
+#if defined(USE_AURA) && defined(OS_WIN)
+ // If we're very early, we can't show a GPU-based dialog, so fallback to
+ // plain Windows MessageBox.
+ if (!ui::ContextFactory::GetInstance())
+ return NativeShowMessageBox(NULL, title, message, type);
+#endif
+
scoped_refptr<SimpleMessageBoxViews> dialog(
new SimpleMessageBoxViews(title, message, type));
CreateBrowserModalDialogViews(dialog.get(), parent)->Show();
« no previous file with comments | « no previous file | chrome/browser/ui/views/simple_message_box_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698