Chromium Code Reviews| 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..129d8e56dd93be555bb939bb45b04626a09f77b3 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() { |
| + ImportLockDialogView::Hide(); |
| +} |
| + |
| } // namespace importer |
| +// For storing widget ptr on creation of dialog widget |
| +// using method CreateDialogWidget. |
|
Ilya Sherman
2017/03/29 06:29:02
nit: I'd simplify this comment to "The currently o
nikhil.sahni
2017/03/30 12:13:35
Done.
|
| +static views::Widget* g_widget = nullptr; |
|
Ilya Sherman
2017/03/29 06:29:02
nit: Please move this to an anonymous namespace.
nikhil.sahni
2017/03/30 12:13:35
Done.
|
| + |
| +// static |
| +void ImportLockDialogView::Hide() { |
| + if (g_widget) |
| + g_widget->CloseNow(); |
|
Ilya Sherman
2017/03/29 06:29:02
I'm pretty sure, based on reading the documentatio
nikhil.sahni
2017/03/30 12:13:35
Done.
|
| +} |
| + |
| // static |
| void ImportLockDialogView::Show(gfx::NativeWindow parent, |
| const base::Callback<void(bool)>& callback) { |
| - views::DialogDelegate::CreateDialogWidget( |
| - new ImportLockDialogView(callback), NULL, NULL)->Show(); |
| + g_widget = views::DialogDelegate::CreateDialogWidget( |
| + new ImportLockDialogView(callback), NULL, NULL); |
| + g_widget->Show(); |
| } |
| ImportLockDialogView::ImportLockDialogView( |