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

Side by Side Diff: chrome/browser/ui/views/simple_message_box_views.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: phajdan feedback Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/simple_message_box.h" 5 #include "chrome/browser/ui/simple_message_box.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/run_loop.h"
11 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
12 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
13 #include "ui/base/l10n/l10n_util.h" 14 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/gfx/native_widget_types.h" 15 #include "ui/gfx/native_widget_types.h"
15 #include "ui/views/controls/message_box_view.h" 16 #include "ui/views/controls/message_box_view.h"
16 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
17 #include "ui/views/window/dialog_delegate.h" 18 #include "ui/views/window/dialog_delegate.h"
18 19
19 #if defined(USE_AURA) 20 #if defined(USE_AURA)
20 #include "ui/aura/client/dispatcher_client.h" 21 #include "ui/aura/client/dispatcher_client.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Use the widget's window itself so that the message loop 173 // Use the widget's window itself so that the message loop
173 // exists when the dialog is closed by some other means than 174 // exists when the dialog is closed by some other means than
174 // |Cancel| or |Accept|. 175 // |Cancel| or |Accept|.
175 aura::Window* anchor = parent ? 176 aura::Window* anchor = parent ?
176 parent : dialog->GetWidget()->GetNativeWindow(); 177 parent : dialog->GetWidget()->GetNativeWindow();
177 aura::client::GetDispatcherClient(anchor->GetRootWindow())-> 178 aura::client::GetDispatcherClient(anchor->GetRootWindow())->
178 RunWithDispatcher(dialog, anchor, true); 179 RunWithDispatcher(dialog, anchor, true);
179 #else 180 #else
180 { 181 {
181 MessageLoop::ScopedNestableTaskAllower allow(MessageLoopForUI::current()); 182 MessageLoop::ScopedNestableTaskAllower allow(MessageLoopForUI::current());
182 MessageLoopForUI::current()->RunWithDispatcher(dialog); 183 base::RunLoop run_loop(dialog);
184 run_loop.Run();
183 } 185 }
184 #endif 186 #endif
185 return dialog->result(); 187 return dialog->result();
186 } 188 }
187 189
188 } // namespace browser 190 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu_browsertest_util.cc ('k') | chrome/browser/ui/views/uninstall_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698