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

Side by Side Diff: chrome/browser/ui/views/user_data_dir_dialog_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, 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
« no previous file with comments | « chrome/browser/ui/views/uninstall_view.cc ('k') | chrome/test/base/bookmark_load_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/views/user_data_dir_dialog_view.h" 5 #include "chrome/browser/ui/views/user_data_dir_dialog_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/run_loop.h"
8 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/user_data_dir_dialog.h" 10 #include "chrome/browser/ui/user_data_dir_dialog.h"
10 #include "grit/chromium_strings.h" 11 #include "grit/chromium_strings.h"
11 #include "grit/generated_resources.h" 12 #include "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/views/controls/message_box_view.h" 14 #include "ui/views/controls/message_box_view.h"
14 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
15 16
16 UserDataDirDialogView::UserDataDirDialogView(const FilePath& user_data_dir) 17 UserDataDirDialogView::UserDataDirDialogView(const FilePath& user_data_dir)
17 : ALLOW_THIS_IN_INITIALIZER_LIST( 18 : ALLOW_THIS_IN_INITIALIZER_LIST(
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 user_data_dir_ = path; 94 user_data_dir_ = path;
94 is_blocking_ = false; 95 is_blocking_ = false;
95 } 96 }
96 97
97 void UserDataDirDialogView::FileSelectionCanceled(void* params) { 98 void UserDataDirDialogView::FileSelectionCanceled(void* params) {
98 } 99 }
99 100
100 namespace browser { 101 namespace browser {
101 102
102 FilePath ShowUserDataDirDialog(const FilePath& user_data_dir) { 103 FilePath ShowUserDataDirDialog(const FilePath& user_data_dir) {
104 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
103 // When the window closes, it will delete itself. 105 // When the window closes, it will delete itself.
104 UserDataDirDialogView* dialog = new UserDataDirDialogView(user_data_dir); 106 UserDataDirDialogView* dialog = new UserDataDirDialogView(user_data_dir);
105 views::Widget::CreateWindow(dialog)->Show(); 107 views::Widget::CreateWindow(dialog)->Show();
106 MessageLoopForUI::current()->RunWithDispatcher(dialog); 108 base::RunLoop run_loop(dialog);
109 run_loop.Run();
107 return dialog->user_data_dir(); 110 return dialog->user_data_dir();
108 } 111 }
109 112
110 } // namespace browser 113 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/uninstall_view.cc ('k') | chrome/test/base/bookmark_load_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698