New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 802169 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Drag and drop files from Files app (Google Drive) -> browser does not open the file.

Project Member Reported by hirono@chromium.org, Jan 16 2018

Issue description

Chrome Version: ToT
OS: Chrome

What steps will reproduce the problem?
(1) Open Drive volume in Files app
(2) Drag an image file from Files app
(3) Drop on a browser window

What is the expected result?
The browser should open the image

What happens instead?
The browser shows an empty page.
 

Comment 1 by hirono@chromium.org, Jan 16 2018

Drag and drop from Donwloads volume to a browser window works as expected.

Status: Assigned (was: Available)
<files-triage>

Comment 3 by sashab@chromium.org, Feb 22 2018

Labels: CrOS-FilesApp-UI

Comment 4 by niwa@chromium.org, Feb 26 2018

Owner: niwa@chromium.org
An externalfile: URL (e.g. "externalfile:drive-a5e...497/root/​filename.png") is set to DropData.url when a drive file is dragged from Files app.

This URL is rejected by ChildProcessSecurityPolicyImpl::CanRequestURL [1] and is replaced by "about:blank" because "externalfile:" is not registered as WebSafeScheme [2].

[1] : Stack trace
ChildProcessSecurityPolicyImpl::CanRequestURL
RenderProcessHostImpl::FilterURL
RenderWidgetHostImpl::FilterDropData
WebContentsViewAura::OnDragEntered

[2] : List of schemes registered as WebSafeScheme in ChildProcessSecurityPolicyImpl
http, https, ftp, data, feed, blob, filesystem

Comment 5 by niwa@chromium.org, Feb 26 2018

I found the following code for whitelisting externalfile:// for ChromeOS in browser_file_system_helper.cc

void PrepareDropDataForChildProcess(...) {
#if defined(OS_CHROMEOS)
  // The externalfile:// scheme is used in Chrome OS to open external files in a
  // browser tab.
  if (drop_data->url.SchemeIs(content::kExternalFileScheme))
    security_policy->GrantRequestURL(child_id, drop_data->url);
#endif

I wonder if we should whitelist externalfile:// for ChromeOS in ChildProcessSecurityPolicyImpl as well.

Comment 6 by niwa@chromium.org, Feb 26 2018

FYI, browser URL box accepts this externalfile: URL.
(Copy/paste-ing the externalfile: URL ("externalfile:drive-a5e...497/root/​filename.png") into the browser URL box opens the drive web page.)

Comment 7 by niwa@chromium.org, Feb 26 2018

Cc: -niwa@chromium.org hirono@chromium.org

Comment 8 by niwa@chromium.org, Feb 27 2018

hirono@-san suggested that handling filesystem: URL might be better than handling external: URL.

I confirmed that DropData contains filesystem: URL below along with externalfile: URL when dragging a GDrive file.

DropData
 url : externalfile:drive-a5e639...81cd497/root/test1.gdoc
 file_system_url : filesystem:chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/external/drive-a5e639...81cd497/root/test1.gdoc

The problem seems to be that DragData::AsURL (function used for obtaining target URL in PerformDrag) never returns filesystem: URL even when DragData contains filesystem: URL.

String DragData::AsURL(FilenameConversionPolicy filename_policy,
                       String* title) const {
  String url;
  if (platform_drag_data_->Types().Contains(kMimeTypeTextURIList))
    platform_drag_data_->UrlAndTitle(url, title);
  else if (filename_policy == kConvertFilenames && ContainsFiles())
    url = FilePathToURL(platform_drag_data_->Filenames()[0]);
  return url;
}

(Call stack)
DragData::AsURL
DragController::PerformDrag
WebFrameWidgetBase::DragTargetDrop

Comment 9 by niwa@chromium.org, Feb 28 2018

Notes of discussions with hirono@

- Currently Files App sets both externalfile URL and filesystem URL into clipboard, but it should actually set only filesystem URL. (file_transfer_controller.js)

- Update browser to converting filesystem URL to externalfile URL in PrepareDropDataForChildProcess

- FileSystemURLToExternalFileURL can be used for the conversion, but the function needs to be moved out of src/chrome/browser/chromeos/... to src/content/...
Labels: -CrOS-FilesApp-UI CrOSFilesCategory-UI
Labels: -CrOSFilesCategory-UI CrOS-FilesApp-DriveSync
Labels: CrOSFilesFeature-DriveSync
Labels: -CrOS-FilesApp-DriveSync
Labels: M-67
Blockedon: 811679

Comment 16 by niwa@chromium.org, Mar 29 2018

Hi hirono-san, is this bug really blocked by 811679 (Migrate callers of ConvertPathToArcUrl) ?


Blockedon: -811679
Oops, sorry I changed wrong bug. Removed blocking issue.
Cc: yusukes@chromium.org
Just a quick check - Can you confirm if this is a known behavior or regression? Are we still targeting this fix for M67?

Comment 19 by niwa@chromium.org, Apr 11 2018

Owner: ----
Status: Available (was: Assigned)
We are not targeting this fix for M67 any more, as we are working on more urgent P tasks now. Unssigning myself.

I think hirono@-san knows whether it's a regression or not.
IIRC, this is a regression issue.
Labels: -Pri-3 -M-67 M-68 Pri-2
Status: WontFix (was: Available)
Hi,

I came across this bug while investigating another issue for files from Drive.

I tried to reproduce and couldn't reproduce on M66: 66.0.3359.137

Nor on my dev device: 68.0.3410.0

I dragged an image file from Files.app (from within Drive) to browser to create a new tab and it showed the image on the browser correctly.

Closing as won't fix. Please re-open if it still occurring.


May 17, 2018 11_42 AM.webm
1.1 MB View Download
Status: Available (was: WontFix)
I could reproduce it with 68.0.3431.0.
It looks the video attached #22 is dragging file from Downloads instead of Drive.
Also please drop a file on the main content area instead of omnibox to reproduce the issue.


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

Labels: -Pri-2 -M-68 M-69 Pri-1
Owner: lucmult@chromium.org
Status: Assigned (was: Available)
Cc: slangley@chromium.org sashab@chromium.org lucmult@chromium.org
Owner: ----
Status: Available (was: Assigned)
Owner: joelhockey@chromium.org
Status: Assigned (was: Available)
Could this be related to issue 862282? Joel, do you have time to take a look?
Labels: -Pri-1 Pri-2
Labels: -M-69 M-70
Labels: -M-70 M-71
Labels: -M-71 M-72
Status: Fixed (was: Assigned)
This is fixed with drivefs.

Sign in to add a comment