Chromium Code Reviews| Index: chrome/browser/extensions/api/file_system/file_system_api.cc |
| diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc |
| index 19ebc89e9efd908fbb7873c9773d295f3ca26f86..f12a3f05536e222f6826c0c885213508158c803f 100644 |
| --- a/chrome/browser/extensions/api/file_system/file_system_api.cc |
| +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc |
| @@ -57,6 +57,7 @@ |
| #include "storage/common/fileapi/file_system_types.h" |
| #include "storage/common/fileapi/file_system_util.h" |
| #include "ui/base/l10n/l10n_util.h" |
| +#include "ui/base/ui_base_types.h" |
| #include "ui/shell_dialogs/select_file_dialog.h" |
| #include "ui/shell_dialogs/selected_file_info.h" |
| @@ -71,9 +72,10 @@ |
| #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| #include "chrome/browser/chromeos/file_manager/app_id.h" |
| #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" |
| -#include "chrome/browser/extensions/api/file_system/request_file_system_dialog_view.h" |
| +#include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| #include "chrome/browser/extensions/api/file_system/request_file_system_notification.h" |
| #include "chrome/browser/ui/simple_message_box.h" |
| +#include "chrome/browser/ui/views/extensions/request_file_system_dialog_view.h" |
| #include "components/user_manager/user_manager.h" |
| #include "extensions/browser/event_router.h" |
| #include "extensions/browser/extension_registry.h" |
| @@ -437,8 +439,18 @@ void ConsentProviderDelegate::ShowDialog( |
| return; |
| } |
| - RequestFileSystemDialogView::ShowDialog(web_contents, extension, volume, |
| - writable, callback); |
| + // If the volume is gone, then cancel the dialog. |
| + if (!volume.get()) { |
| + base::ThreadTaskRunnerHandle::Get()->PostTask( |
| + FROM_HERE, base::Bind(callback, ui::DIALOG_BUTTON_CANCEL)); |
| + return; |
| + } |
| + |
| + RequestFileSystemDialogView::ShowDialog( |
| + web_contents, extension.name(), |
| + ((volume->volume_label().empty() == false) ? volume->volume_label() |
|
Peter Kasting
2017/04/27 01:50:33
Discussed this in person :)
ananta
2017/04/27 01:55:16
Done.
|
| + : volume->volume_id()), |
| + writable, callback); |
| } |
| void ConsentProviderDelegate::ShowNotification( |