Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 2816293002: Description: Replace layout constants in chrome/browser/extensions and chrome/browser/first_run (Closed)
Patch Set: Address review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..966ec6635852503db2694689f1fab495b39c56f9 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() ? volume->volume_id()
+ : volume->volume_label()),
+ writable, callback);
}
void ConsentProviderDelegate::ShowNotification(

Powered by Google App Engine
This is Rietveld 408576698