Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Issue 144783002: Simplify directory initialization in Files app. (Closed)

Created:
6 years, 11 months ago by mtomasz
Modified:
6 years, 10 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, tfarina, rginda+watch_chromium.org, mtomasz+watch_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Simplify directory initialization in Files app. This patch cleans up the initialization code, by separating the current directory from selection. Before, there was only one variable holding either current directory or the selection, and heuristics were used to determine how to interpred the path there. The new code is also a preparation for migrating to URLs, since there are no more operations on the passed paths on the JS side. Note, that before we were fetching parent of a non existing path, which would be very tricky after migrating to URLs. And finally, this patch fixes wrong behaviour of the select directory dialog. Since now, the selected directory is really selected, and not opened. TEST=Tested manually several scenarios. All dialogs + recovering from crash. Drive and Downloads. BUG=328767, 321962 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247556

Patch Set 1 #

Total comments: 10

Patch Set 2 : Fixed. #

Total comments: 23

Patch Set 3 : Addressed comments. #

Patch Set 4 : Rebased. #

Patch Set 5 : Fixed tests. #

Patch Set 6 : Fixed tests. #

Patch Set 7 : Cleaned up. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -239 lines) Patch
M chrome/browser/chromeos/file_manager/url_util.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/file_manager/url_util.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_manager/url_util_unittest.cc View 1 2 3 4 4 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/resources/file_manager/background/js/background.js View 3 chunks +29 lines, -11 lines 0 comments Download
M chrome/browser/resources/file_manager/common/js/util.js View 1 2 2 chunks +17 lines, -15 lines 0 comments Download
M chrome/browser/resources/file_manager/foreground/js/file_manager.js View 1 2 3 12 chunks +104 lines, -136 lines 0 comments Download
M chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/file_manager/foreground/js/file_tasks.js View 1 2 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/resources/file_manager/foreground/js/photo/gallery.js View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/ui/views/select_file_dialog_extension.cc View 1 2 3 4 5 3 chunks +65 lines, -41 lines 0 comments Download
M chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc View 1 2 3 4 5 6 3 chunks +4 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js View 1 2 3 25 chunks +25 lines, -25 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
mtomasz
@kinaba: PTAL at C++ @hirono: PTAL at JS. This is the second approach. The next ...
6 years, 11 months ago (2014-01-22 06:45:44 UTC) #1
kinaba
C++ lgtm https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/foreground/js/file_manager.js File chrome/browser/resources/file_manager/foreground/js/file_manager.js (right): https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/foreground/js/file_manager.js#newcode1411 chrome/browser/resources/file_manager/foreground/js/file_manager.js:1411: console.log(nextCurrentDirEntry, selectionEntry); Don't forget to remove these ...
6 years, 11 months ago (2014-01-23 04:58:02 UTC) #2
hirono
https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/background/js/background.js File chrome/browser/resources/file_manager/background/js/background.js (right): https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/background/js/background.js#newcode535 chrome/browser/resources/file_manager/background/js/background.js:535: if (opt_appState.currentDirectoryPath !== Please also update appStates in chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js. ...
6 years, 11 months ago (2014-01-23 05:35:56 UTC) #3
mtomasz
https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/background/js/background.js File chrome/browser/resources/file_manager/background/js/background.js (right): https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/background/js/background.js#newcode535 chrome/browser/resources/file_manager/background/js/background.js:535: if (opt_appState.currentDirectoryPath !== On 2014/01/23 05:35:57, hirono wrote: > ...
6 years, 11 months ago (2014-01-23 06:27:04 UTC) #4
hirono
On 2014/01/23 06:27:04, mtomasz wrote: > https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/background/js/background.js > File chrome/browser/resources/file_manager/background/js/background.js (right): > > https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/background/js/background.js#newcode535 > ...
6 years, 11 months ago (2014-01-23 06:43:06 UTC) #5
hirono
https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/common/js/util.js File chrome/browser/resources/file_manager/common/js/util.js (right): https://codereview.chromium.org/144783002/diff/1/chrome/browser/resources/file_manager/common/js/util.js#newcode685 chrome/browser/resources/file_manager/common/js/util.js:685: util.updateAppState = function(currentDirectoryPath, selectionPath, opt_param) { On 2014/01/23 06:27:04, ...
6 years, 11 months ago (2014-01-23 06:43:17 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/144783002/80001
6 years, 11 months ago (2014-01-23 08:06:12 UTC) #7
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=46039
6 years, 11 months ago (2014-01-23 08:20:36 UTC) #8
mtomasz
On 2014/01/23 08:20:36, I haz the power (commit-bot) wrote: > Retried try job too often ...
6 years, 11 months ago (2014-01-23 08:27:08 UTC) #9
Peter Kasting
https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc File chrome/browser/ui/views/select_file_dialog_extension.cc (right): https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc#newcode299 chrome/browser/ui/views/select_file_dialog_extension.cc:299: NOTREACHED() << "File dialog opened by panel."; Nit: While ...
6 years, 11 months ago (2014-01-24 19:17:19 UTC) #10
mtomasz
https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc File chrome/browser/ui/views/select_file_dialog_extension.cc (right): https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc#newcode299 chrome/browser/ui/views/select_file_dialog_extension.cc:299: NOTREACHED() << "File dialog opened by panel."; On 2014/01/24 ...
6 years, 11 months ago (2014-01-27 02:38:43 UTC) #11
mtomasz
On 2014/01/27 02:38:43, mtomasz wrote: > https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc > File chrome/browser/ui/views/select_file_dialog_extension.cc (right): > > https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc#newcode299 > ...
6 years, 10 months ago (2014-01-28 00:11:26 UTC) #12
mtomasz
On 2014/01/28 00:11:26, mtomasz wrote: > On 2014/01/27 02:38:43, mtomasz wrote: > > > https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc ...
6 years, 10 months ago (2014-01-28 00:22:52 UTC) #13
sky
LGTM
6 years, 10 months ago (2014-01-28 00:45:56 UTC) #14
mtomasz
On 2014/01/28 00:45:56, sky wrote: > LGTM Thanks for the fast reply!
6 years, 10 months ago (2014-01-28 00:46:36 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/144783002/480001
6 years, 10 months ago (2014-01-28 00:48:39 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/144783002/560002
6 years, 10 months ago (2014-01-28 02:07:34 UTC) #17
Peter Kasting
(Just FYI, since you asked some questions) https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc File chrome/browser/ui/views/select_file_dialog_extension.cc (right): https://codereview.chromium.org/144783002/diff/80001/chrome/browser/ui/views/select_file_dialog_extension.cc#newcode350 chrome/browser/ui/views/select_file_dialog_extension.cc:350: base::FilePath fallback_path ...
6 years, 10 months ago (2014-01-28 03:22:03 UTC) #18
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=252622
6 years, 10 months ago (2014-01-28 03:34:23 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/144783002/480002
6 years, 10 months ago (2014-01-28 18:24:26 UTC) #20
commit-bot: I haz the power
6 years, 10 months ago (2014-01-29 01:08:00 UTC) #21
Message was sent while issue was closed.
Change committed as 247556

Powered by Google App Engine
This is Rietveld 408576698