Index: chrome/browser/ui/views/importer/import_lock_dialog_view.cc |
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc |
index 061fceb48ea3a6ac4271d93e229ccfcf97703c79..3b76a354eaeb838e3ce212bb0c6110cfe4f8d55f 100644 |
--- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc |
+++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc |
@@ -30,13 +30,28 @@ void ShowImportLockDialog(gfx::NativeWindow parent, |
content::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); |
} |
+void HideImportLockDialog() { |
Ilya Sherman
2017/03/27 15:21:52
You'll need to also implement this method for Mac,
nikhil.sahni
2017/03/28 11:22:00
Hi Ilya Sherman,
Thanks for pointing this out , I
|
+ ImportLockDialogView::Hide(); |
+} |
+ |
} // namespace importer |
+views::Widget* ImportLockDialogView::m_widget = NULL; |
Ilya Sherman
2017/03/27 15:21:52
nit: s/NULL/nullptr
nikhil.sahni
2017/03/28 11:22:00
Done.
|
+ |
+// static |
+void ImportLockDialogView::Hide() { |
+ if (m_widget) { |
Ilya Sherman
2017/03/27 15:21:52
It looks like the widget can be destroyed without
nikhil.sahni
2017/03/28 11:22:00
Here I guess there won't be any issue as even if i
Ilya Sherman
2017/03/29 06:29:02
At a minimum, you'll want to reset g_widget to nul
nikhil.sahni
2017/03/30 12:13:35
yes you are right this case needs to be handled, b
|
+ m_widget->Hide(); |
+ m_widget->CloseNow(); |
Ilya Sherman
2017/03/27 15:21:52
Hmm, is it actually necessary to call both of thes
nikhil.sahni
2017/03/28 11:22:00
Done.
|
+ } |
+} |
+ |
// static |
void ImportLockDialogView::Show(gfx::NativeWindow parent, |
const base::Callback<void(bool)>& callback) { |
- views::DialogDelegate::CreateDialogWidget( |
- new ImportLockDialogView(callback), NULL, NULL)->Show(); |
+ m_widget = views::DialogDelegate::CreateDialogWidget( |
+ new ImportLockDialogView(callback), NULL, NULL); |
+ m_widget->Show(); |
} |
ImportLockDialogView::ImportLockDialogView( |