Index: chrome/browser/ui/views/user_data_dir_dialog_view.cc |
diff --git a/chrome/browser/ui/views/user_data_dir_dialog_view.cc b/chrome/browser/ui/views/user_data_dir_dialog_view.cc |
index 138db16bb5a1980529f4d2276756b3fa806d81f1..8c83f13fce8bb15f87e6e626a4a30c72056190ec 100644 |
--- a/chrome/browser/ui/views/user_data_dir_dialog_view.cc |
+++ b/chrome/browser/ui/views/user_data_dir_dialog_view.cc |
@@ -103,7 +103,17 @@ void UserDataDirDialogView::FileSelectionCanceled(void* params) { |
namespace chrome { |
+base::Closure g_custom_callback_for_test; |
sky
2013/03/22 23:14:27
Constants like this can not be objects.
hshi1
2013/03/22 23:51:04
Done. (Made it a pointer, and moved to extractor_w
|
+void InstallCustomShowUserDataDirDialogCallbackForTest( |
+ const base::Closure& callback) { |
+ g_custom_callback_for_test = callback; |
+} |
+ |
base::FilePath ShowUserDataDirDialog(const base::FilePath& user_data_dir) { |
+ if (!g_custom_callback_for_test.is_null()) { |
+ g_custom_callback_for_test().Run(); |
+ return base::FilePath(); |
+ } |
DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
// When the window closes, it will delete itself. |
UserDataDirDialogView* dialog = new UserDataDirDialogView(user_data_dir); |