New issue
Advanced search Search tips

Issue 658839 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 632454



Sign in to add a comment

SelectFileDialog: Each use with SELECT_UPLOAD_FOLDER sets last selected directory to parent

Project Member Reported by jsb...@chromium.org, Oct 24 2016

Issue description

Each time a directory is chosen for upload, Chrome's "last selected directory" profile entry is set to the parent, slowly walking up the file system.

Repro:

1. Open attached page, which is just: <input type=file webkitdirectory>
2. Pick some deeply nested directory
3. Go back to step 1

Expected:

* Either defaults to the same place each time (e.g. user's home dir) *or* defaults to the last selected directory

Actual:

* Defaults to parent of last selected directory

This is coming from:

Browser::FileSelectedWithExtraInfo

Which runs:

profile_->set_last_selected_directory(file_info.file_path.DirName());

... which makes sense if picking a *file* but not when picking a *directory*

 
wkd.html
50 bytes View Download

Comment 1 by jsb...@chromium.org, Oct 24 2016

Blockedon: 632454
Note that  issue 632454  makes this a pain to test.

Comment 2 by tkent@chromium.org, Oct 24 2016

Status: Available (was: Untriaged)

Comment 3 by jsb...@chromium.org, Oct 25 2016

Status: Started (was: Available)
I have https://codereview.chromium.org/2450543002 in progress, need tests though
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 28 2016

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

commit 0d496dc3e2fd36916d35da7f0afa60aa9b18ab4a
Author: jsbell <jsbell@chromium.org>
Date: Fri Oct 28 22:23:57 2016

Directory upload: remember the last directory chosen, not its parent

When using a file picker, the parent directory of the chosen file is
remembered so that the next file picker starts in the same place. But
when a directory picker is used the directory itself should be
remembered. Make it so.

BUG= 658839 
R=nasko@chromium.org

Review-Url: https://codereview.chromium.org/2450543002
Cr-Commit-Position: refs/heads/master@{#428521}

[modify] https://crrev.com/0d496dc3e2fd36916d35da7f0afa60aa9b18ab4a/chrome/browser/file_select_helper.cc
[modify] https://crrev.com/0d496dc3e2fd36916d35da7f0afa60aa9b18ab4a/chrome/browser/file_select_helper.h
[modify] https://crrev.com/0d496dc3e2fd36916d35da7f0afa60aa9b18ab4a/chrome/browser/file_select_helper_unittest.cc

Comment 5 by jsb...@chromium.org, Oct 28 2016

Status: Fixed (was: Started)

Sign in to add a comment