New issue
Advanced search Search tips

Issue 843881 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 841038



Sign in to add a comment

Disallow picking hosted docs in select file dialogs when a real file is required

Project Member Reported by lucmult@chromium.org, May 17 2018

Issue description

Drive has special files .gdoc .gsheet, etc.

Those files are intended to be a local pointer to the file on Drive, so when opening such files it's expected to open it in Drive/Docs/etc.

It starts to get confusing on some other scenarios:

1. User have .gdoc file within Drive (this shouldn't happen) since there is no point to link a Drive file to another Drive file.

2. User tries to attach a .gdoc file like on gmail or any web form, it's confusing to user what's the expected behaviour, since the file content won't be attached or it might fail entirely if .gdoc file is within Drive ( crbug.com/841038 ).

DriveFS disallow copying those files to Drive.

Some internal reference about this issue: b/8543214 (from Drive team).
 
Blocking: 841038
Another examples problem of .gdoc file: 
-  crbug.com/811463  "Zip Archiver: Hosted documents are not zipped correctly when zipping on Drive"
- crbug.com/843449 "Hosted documents do not appear in the Files app after synced"

Comment 3 by sashab@google.com, May 24 2018

Labels: CrOSFilesFeature-DriveSync
Status: Available (was: Untriaged)
We should grey-out the Attach button for hosted files when using the file picker.

Comment 4 by sashab@chromium.org, May 26 2018

Components: Platform>Apps>FileManager

Comment 5 by sashab@chromium.org, May 26 2018

Components: -Platform>Apps>FileManager>Drive
Cc: -sashab@chromium.org
Owner: sa...@chromium.org
Status: Assigned (was: Available)
Summary: Disallow picking hosted docs in select file dialogs when a real file is required (was: Files app: Managing Drive files .gdoc, .gsheets, etc.)
By default, file picker dialogs will disallow picking hosted docs.

FileSelectDialog clients will be able to opt into receiving URLs as well as file paths; this will allow the browser to continue opening hosted docs (and files from FSPs) without the special-casing in browser.cc: https://cs.chromium.org/chromium/src/chrome/browser/ui/browser.cc?l=1994&rcl=9760426c81975ec921a7d4b022bcc4dae210ec65.
Labels: Target-73 Treadstone
Project Member

Comment 8 by bugdroid1@chromium.org, Dec 4

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/efdb12464a70a03df64cd991891d7ef66bac28a8

commit efdb12464a70a03df64cd991891d7ef66bac28a8
Author: Sam McNally <sammc@chromium.org>
Date: Tue Dec 04 05:54:18 2018

Add tests for the Files app acting as a save as dialog.

Bug:  843881 
Change-Id: Icb4733b284f6dc18696184096325870ebfb3ab6a
Reviewed-on: https://chromium-review.googlesource.com/c/1359933
Reviewed-by: Noel Gordon <noel@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613443}
[modify] https://crrev.com/efdb12464a70a03df64cd991891d7ef66bac28a8/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
[modify] https://crrev.com/efdb12464a70a03df64cd991891d7ef66bac28a8/ui/file_manager/integration_tests/file_manager/file_dialog.js

 Issue 910755  has been merged into this issue.
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3429b21df57fb03c658e5b63ae81a42f4316a978

commit 3429b21df57fb03c658e5b63ae81a42f4316a978
Author: Sam McNally <sammc@chromium.org>
Date: Fri Dec 07 01:25:24 2018

Add ui::SelectFileDialog::FileTypeInfo::ANY_PATH_OR_URL.

For most file select dialogs, hosted docs that can only be accessed via
their URLs are not useful to select. Only browser file-open dialogs can
meaningfully interact with these virtual files, translating their paths
into URLs. Other dialogs return unusable file paths that cannot be
opened as regular files, causing unnecessary and confusing failures.

Add a FileTypeInfo enumerator, ANY_PATH_OR_URL, for clients to opt into
accepting such virtual files, used by Browser. In dialogs not opting
into this mode, disallow selecting hosted docs.

Bug:  843881 
Change-Id: I8abc6408e94d60d6e8b3889b0899038c90789119
Reviewed-on: https://chromium-review.googlesource.com/c/1360451
Reviewed-by: Noel Gordon <noel@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614556}
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/chrome/browser/chromeos/file_manager/url_util.cc
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/chrome/browser/ui/browser.cc
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/base/js/filtered_volume_manager.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/base/js/volume_manager_types.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/css/file_manager.css
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/constants.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/file_manager.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/file_selection.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/launch_param.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/ui/file_table.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/file_manager/foreground/js/ui/file_table_list.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/file_manager/integration_tests/file_manager/file_dialog.js
[modify] https://crrev.com/3429b21df57fb03c658e5b63ae81a42f4316a978/ui/shell_dialogs/select_file_dialog.h

Project Member

Comment 12 by bugdroid1@chromium.org, Dec 7

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53fe68888c1b3e844195142b6ddba163bab85cd9

commit 53fe68888c1b3e844195142b6ddba163bab85cd9
Author: Sam McNally <sammc@chromium.org>
Date: Fri Dec 07 05:21:39 2018

Add support for returning URLs from SelectFileDialogs.

On ChromeOS, filesystem provider-provided files should be accessed via
an externalfile URL. Further, hosted gdocs should be redirected to their
URLs. Currently, this is handled within Browser.

Add a |url| field to SelectedFileInfo to allow communicating these
values from the dialog to Browser to avoid needing to leak this into
Browser. Migrate this special-casing into the existing handling of
SelectFileDialog results on ChromeOS, populating the |url| there.

Bug:  843881 
Change-Id: I9808cdbf38fb4da26b99c8a45f8bda4fd0bee9a7
Reviewed-on: https://chromium-review.googlesource.com/c/1360812
Commit-Queue: Sam McNally <sammc@chromium.org>
Reviewed-by: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: Noel Gordon <noel@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614615}
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/chrome/browser/chromeos/fileapi/external_file_url_util.cc
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/chrome/browser/chromeos/fileapi/external_file_url_util.h
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/chrome/browser/ui/browser.cc
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/ui/file_manager/integration_tests/file_manager/file_dialog.js
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/ui/shell_dialogs/BUILD.gn
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/ui/shell_dialogs/selected_file_info.cc
[modify] https://crrev.com/53fe68888c1b3e844195142b6ddba163bab85cd9/ui/shell_dialogs/selected_file_info.h

Status: Fixed (was: Assigned)

Sign in to add a comment