Commit 9acfcab1 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[NativeFS] Don't re-check for user activation when re-showing file picker.

User activation will have likely expired by this time, but we should still
show a picker again if the user opted for selecting a different file/folder
after selecting a restricted one initially.

Bug: 996224
Change-Id: I12fcccaab5a5447b1da266537e0afc373a47dbc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764887
Auto-Submit: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689719}
parent 07ead0ce
......@@ -42,6 +42,7 @@ namespace {
void ShowFilePickerOnUIThread(const url::Origin& requesting_origin,
int render_process_id,
int frame_id,
bool require_user_gesture,
const FileSystemChooser::Options& options,
FileSystemChooser::ResultCallback callback,
scoped_refptr<base::TaskRunner> callback_runner) {
......@@ -78,7 +79,7 @@ void ShowFilePickerOnUIThread(const url::Origin& requesting_origin,
// IPC, but just to be sure double check here as well. This is not treated
// as a BadMessage because it is possible for the transient user activation
// to expire between the renderer side check and this check.
if (!rfh->HasTransientUserActivation()) {
if (require_user_gesture && !rfh->HasTransientUserActivation()) {
callback_runner->PostTask(
FROM_HERE,
base::BindOnce(
......@@ -192,7 +193,7 @@ void NativeFileSystemManagerImpl::ChooseEntries(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(
&ShowFilePickerOnUIThread, context.origin, context.process_id,
context.frame_id, options,
context.frame_id, /*require_user_gesture=*/true, options,
base::BindOnce(&NativeFileSystemManagerImpl::DidChooseEntries,
weak_factory_.GetWeakPtr(), context, options,
std::move(callback)),
......@@ -423,7 +424,8 @@ void NativeFileSystemManagerImpl::DidVerifySensitiveDirectoryAccess(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(
&ShowFilePickerOnUIThread, binding_context.origin,
binding_context.process_id, binding_context.frame_id, options,
binding_context.process_id, binding_context.frame_id,
/*require_user_gesture=*/false, options,
base::BindOnce(&NativeFileSystemManagerImpl::DidChooseEntries,
weak_factory_.GetWeakPtr(), binding_context, options,
std::move(callback)),
......
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