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

Unified Diff: chrome/browser/ui/views/uninstall_view.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, 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 | « chrome/browser/ui/views/uninstall_view.h ('k') | chrome/browser/ui/views/user_data_dir_dialog_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/uninstall_view.cc
diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc
index 808d245b8790141ae4e95b6a74eca9f36b5ea05e..41fee09cdc52be0fd5ef327ae8d9ab90a6ccc9e4 100644
--- a/chrome/browser/ui/views/uninstall_view.cc
+++ b/chrome/browser/ui/views/uninstall_view.cc
@@ -6,6 +6,7 @@
#include "base/message_loop.h"
#include "base/process_util.h"
+#include "base/run_loop.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/shell_integration.h"
@@ -23,19 +24,21 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
-UninstallView::UninstallView(int* user_selection)
+UninstallView::UninstallView(int* user_selection,
+ const base::Closure& quit_closure)
: confirm_label_(NULL),
delete_profile_(NULL),
change_default_browser_(NULL),
browsers_combo_(NULL),
browsers_(NULL),
- user_selection_(*user_selection) {
+ user_selection_(*user_selection),
+ quit_closure_(quit_closure) {
SetupControls();
}
UninstallView::~UninstallView() {
// Exit the message loop we were started with so that uninstall can continue.
- MessageLoop::current()->Quit();
+ quit_closure_.Run();
}
void UninstallView::SetupControls() {
@@ -164,10 +167,13 @@ string16 UninstallView::GetItemAt(int index) {
namespace browser {
int ShowUninstallBrowserPrompt() {
+ DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
int result = content::RESULT_CODE_NORMAL_EXIT;
- views::Widget::CreateWindow(new UninstallView(&result))->Show();
views::AcceleratorHandler accelerator_handler;
- MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler);
+ base::RunLoop run_loop(&accelerator_handler);
+ UninstallView* view = new UninstallView(&result, run_loop.QuitClosure());
+ views::Widget::CreateWindow(view)->Show();
+ run_loop.Run();
return result;
}
« no previous file with comments | « chrome/browser/ui/views/uninstall_view.h ('k') | chrome/browser/ui/views/user_data_dir_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698