OLD | NEW |
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/run_loop.h" |
9 #include "chrome/browser/ui/chrome_select_file_policy.h" | 9 #include "chrome/browser/ui/chrome_select_file_policy.h" |
10 #include "chrome/browser/ui/user_data_dir_dialog.h" | 10 #include "chrome/browser/ui/user_data_dir_dialog.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 user_data_dir_ = path; | 96 user_data_dir_ = path; |
97 is_blocking_ = false; | 97 is_blocking_ = false; |
98 } | 98 } |
99 | 99 |
100 void UserDataDirDialogView::FileSelectionCanceled(void* params) { | 100 void UserDataDirDialogView::FileSelectionCanceled(void* params) { |
101 } | 101 } |
102 | 102 |
103 namespace chrome { | 103 namespace chrome { |
104 | 104 |
105 base::FilePath ShowUserDataDirDialog(const base::FilePath& user_data_dir) { | 105 base::FilePath ShowUserDataDirDialog(const base::FilePath& user_data_dir) { |
106 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); | 106 DCHECK(base::MessageLoopForUI::IsCurrent()); |
107 // When the window closes, it will delete itself. | 107 // When the window closes, it will delete itself. |
108 UserDataDirDialogView* dialog = new UserDataDirDialogView(user_data_dir); | 108 UserDataDirDialogView* dialog = new UserDataDirDialogView(user_data_dir); |
109 views::DialogDelegate::CreateDialogWidget(dialog, NULL, NULL)->Show(); | 109 views::DialogDelegate::CreateDialogWidget(dialog, NULL, NULL)->Show(); |
110 base::RunLoop run_loop(dialog); | 110 base::RunLoop run_loop(dialog); |
111 run_loop.Run(); | 111 run_loop.Run(); |
112 return dialog->user_data_dir(); | 112 return dialog->user_data_dir(); |
113 } | 113 } |
114 | 114 |
115 } // namespace chrome | 115 } // namespace chrome |
OLD | NEW |