Commit 5ad04230 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

DevTools: Report cancellation separately for SelectFile events

The second argument to new SelectFileDialog() is actually for the
cancelled case, not the error case. We were treating this as an error.

Now we report cancellation explicitly, and the frontend can handle it
as appropriate.

We still use kPermissionDenied for other cases where permission
actually was denied.

Frontend change:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2089898/

Bug: chromium:787728
Change-Id: I3cb32ad04a366760b771b4ccbc45367a8e4c4bc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089837Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747636}
parent 0870173a
...@@ -55,6 +55,7 @@ namespace { ...@@ -55,6 +55,7 @@ namespace {
static const char kRootName[] = "<root>"; static const char kRootName[] = "<root>";
static const char kPermissionDenied[] = "<permission denied>"; static const char kPermissionDenied[] = "<permission denied>";
static const char kSelectionCancelled[] = "<selection cancelled>";
base::LazyInstance<base::FilePath>::Leaky base::LazyInstance<base::FilePath>::Leaky
g_last_save_path = LAZY_INSTANCE_INITIALIZER; g_last_save_path = LAZY_INSTANCE_INITIALIZER;
...@@ -313,7 +314,7 @@ void DevToolsFileHelper::AddFileSystem( ...@@ -313,7 +314,7 @@ void DevToolsFileHelper::AddFileSystem(
Bind(&DevToolsFileHelper::InnerAddFileSystem, weak_factory_.GetWeakPtr(), Bind(&DevToolsFileHelper::InnerAddFileSystem, weak_factory_.GetWeakPtr(),
show_info_bar_callback, type), show_info_bar_callback, type),
Bind(&DevToolsFileHelper::FailedToAddFileSystem, Bind(&DevToolsFileHelper::FailedToAddFileSystem,
weak_factory_.GetWeakPtr(), kPermissionDenied), weak_factory_.GetWeakPtr(), kSelectionCancelled),
web_contents_); web_contents_);
select_file_dialog->Show(ui::SelectFileDialog::SELECT_FOLDER, select_file_dialog->Show(ui::SelectFileDialog::SELECT_FOLDER,
base::FilePath()); base::FilePath());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment