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

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

Issue 10536075: Use proper anchor window in SimpleMessageBoxViews (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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/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 20f6c6c421c4b3e8f88b09131cae704c32c13bed..763634179e4ce0f47390a002fbee27177f6def8e 100644
--- a/chrome/browser/ui/views/simple_message_box_views.cc
+++ b/chrome/browser/ui/views/simple_message_box_views.cc
@@ -34,7 +34,6 @@ class SimpleMessageBoxViews : public views::DialogDelegate,
MessageBoxResult result() const { return result_; }
- private:
virtual ~SimpleMessageBoxViews();
// Overridden from views::DialogDelegate:
@@ -54,6 +53,7 @@ class SimpleMessageBoxViews : public views::DialogDelegate,
// Overridden from MessageLoop::Dispatcher:
virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
+ private:
const string16 window_title_;
const MessageBoxType type_;
MessageBoxResult result_;
@@ -160,15 +160,19 @@ MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
views::Widget::CreateWindowWithParent(dialog, parent)->Show();
#if defined(USE_AURA)
- aura::client::GetDispatcherClient(parent->GetRootWindow())->RunWithDispatcher(
- dialog, parent, true);
+ // Use the widget's window itself so that the message loop
+ // exists when the dialog is closed by some other means than
+ // |Cancel| or |Accept|.
+ aura::Window* anchor = parent ?
+ parent : dialog->GetWidget()->GetNativeWindow();
+ aura::client::GetDispatcherClient(anchor->GetRootWindow())->
+ RunWithDispatcher(dialog, anchor, true);
#else
{
MessageLoop::ScopedNestableTaskAllower allow(MessageLoopForUI::current());
MessageLoopForUI::current()->RunWithDispatcher(dialog);
}
#endif
-
return dialog->result();
}
« 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