Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Issue 9651028: filechooser: Add SelectedFileInfo class to pass display names to WebKit (Closed)

Created:
8 years, 9 months ago by satorux1
Modified:
8 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, zel
Visibility:
Public.

Description

filechooser: Add SelectedFileInfo class to pass display names to WebKit Files on gdata are cached locally with human unreadable names like /blah/gdata/cache/d41d8cd98f00b204e9800998ecf8427e. When these files are selected from the file chooser for uploading from <form>, we should pass display names, in addition to real paths, to WebKit, so the proper names are shown in web pages, and used for uploading. This patch simply adds SelectedFileInfo with minimal code changes. There should be no behavior changes. The file selection code for Chrome OS will be changed in a separate patch. BUG=chromium-os:27222 TEST=try bots. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=126606

Patch Set 1 #

Patch Set 2 : polish #

Patch Set 3 : polish #

Total comments: 9

Patch Set 4 : address comments #

Patch Set 5 : StringType #

Patch Set 6 : rebased #

Total comments: 6

Patch Set 7 : address comments #

Patch Set 8 : add selected_file_info.h #

Total comments: 16

Patch Set 9 : address jam's comments #

Patch Set 10 : add a missing #include #

Patch Set 11 : copyright years #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -23 lines) Patch
M chrome/browser/file_select_helper.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/file_select_helper.cc View 1 2 3 4 5 6 7 8 9 chunks +43 lines, -7 lines 0 comments Download
M chrome/browser/ui/select_file_dialog.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +15 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -4 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -1 line 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/render_view_host.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
A content/public/common/selected_file_info.h View 1 2 3 4 5 6 7 1 chunk +39 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
satorux1
Hi Darin and Kinuko, Please take a look. Once I get go-ahead from you, I'll ...
8 years, 9 months ago (2012-03-09 18:19:06 UTC) #1
kinuko (google)
The code itself looking good, added some cosmetic comments. http://codereview.chromium.org/9651028/diff/6001/chrome/browser/ui/select_file_dialog.h File chrome/browser/ui/select_file_dialog.h (right): http://codereview.chromium.org/9651028/diff/6001/chrome/browser/ui/select_file_dialog.h#newcode69 chrome/browser/ui/select_file_dialog.h:69: ...
8 years, 9 months ago (2012-03-09 19:16:57 UTC) #2
satorux1
http://codereview.chromium.org/9651028/diff/6001/chrome/browser/ui/select_file_dialog.h File chrome/browser/ui/select_file_dialog.h (right): http://codereview.chromium.org/9651028/diff/6001/chrome/browser/ui/select_file_dialog.h#newcode69 chrome/browser/ui/select_file_dialog.h:69: // FilePath. Used for passing extra information (ex. display ...
8 years, 9 months ago (2012-03-09 19:29:26 UTC) #3
satorux1
http://codereview.chromium.org/9651028/diff/6001/content/public/common/file_chooser_params.h File content/public/common/file_chooser_params.h (right): http://codereview.chromium.org/9651028/diff/6001/content/public/common/file_chooser_params.h#newcode25 content/public/common/file_chooser_params.h:25: FilePath display_path; On 2012/03/09 19:29:26, satorux1 wrote: > On ...
8 years, 9 months ago (2012-03-09 21:38:36 UTC) #4
kinuko
LGTM (though you'll need more lgtm's)
8 years, 9 months ago (2012-03-13 10:58:02 UTC) #5
satorux1
adding sky@ for chrome/browser/ui/... jam@ for content/public/...
8 years, 9 months ago (2012-03-13 16:56:29 UTC) #6
sky
http://codereview.chromium.org/9651028/diff/10001/chrome/browser/file_select_helper.cc File chrome/browser/file_select_helper.cc (right): http://codereview.chromium.org/9651028/diff/10001/chrome/browser/file_select_helper.cc#newcode217 chrome/browser/file_select_helper.cc:217: content::SelectedFileInfo(entry->results_[i], FilePath::StringType())); Isn't this the same as 134-137. How ...
8 years, 9 months ago (2012-03-13 17:41:50 UTC) #7
satorux1
http://codereview.chromium.org/9651028/diff/10001/chrome/browser/file_select_helper.cc File chrome/browser/file_select_helper.cc (right): http://codereview.chromium.org/9651028/diff/10001/chrome/browser/file_select_helper.cc#newcode217 chrome/browser/file_select_helper.cc:217: content::SelectedFileInfo(entry->results_[i], FilePath::StringType())); On 2012/03/13 17:41:50, sky wrote: > Isn't ...
8 years, 9 months ago (2012-03-13 18:01:28 UTC) #8
sky
LGTM
8 years, 9 months ago (2012-03-13 18:20:51 UTC) #9
satorux1
forgot to add jam@ for content/public changes.
8 years, 9 months ago (2012-03-13 18:21:51 UTC) #10
jam
for content api, you need to put every class/struct in a separate file. we also ...
8 years, 9 months ago (2012-03-13 19:30:18 UTC) #11
satorux1
On 2012/03/13 19:30:18, John Abd-El-Malek wrote: > for content api, you need to put every ...
8 years, 9 months ago (2012-03-13 19:39:03 UTC) #12
jam
On 2012/03/13 19:39:03, satorux1 wrote: > On 2012/03/13 19:30:18, John Abd-El-Malek wrote: > > for ...
8 years, 9 months ago (2012-03-13 19:59:08 UTC) #13
satorux1
On 2012/03/13 19:59:08, John Abd-El-Malek wrote: > On 2012/03/13 19:39:03, satorux1 wrote: > > On ...
8 years, 9 months ago (2012-03-13 20:52:05 UTC) #14
jam
lgtm with nits addressed http://codereview.chromium.org/9651028/diff/14005/chrome/browser/file_select_helper.cc File chrome/browser/file_select_helper.cc (right): http://codereview.chromium.org/9651028/diff/14005/chrome/browser/file_select_helper.cc#newcode227 chrome/browser/file_select_helper.cc:227: = ConvertToSelectedFileInfoList(entry->results_); nit: the "=" ...
8 years, 9 months ago (2012-03-14 00:47:00 UTC) #15
satorux1
8 years, 9 months ago (2012-03-14 06:20:59 UTC) #16
https://chromiumcodereview.appspot.com/9651028/diff/14005/chrome/browser/file...
File chrome/browser/file_select_helper.cc (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/chrome/browser/file...
chrome/browser/file_select_helper.cc:227: =
ConvertToSelectedFileInfoList(entry->results_);
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: the "=" should be on the previous line per the style guide

Done.

https://chromiumcodereview.appspot.com/9651028/diff/14005/chrome/browser/file...
File chrome/browser/file_select_helper.h (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/chrome/browser/file...
chrome/browser/file_select_helper.h:16: #include
"content/public/common/selected_file_info.h"
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: forward declare

Done.

https://chromiumcodereview.appspot.com/9651028/diff/14005/chrome/browser/ui/s...
File chrome/browser/ui/select_file_dialog.h (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/chrome/browser/ui/s...
chrome/browser/ui/select_file_dialog.h:15: #include
"content/public/common/selected_file_info.h"
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: forward declare

Done.

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/browser/ren...
File content/browser/renderer_host/render_view_host_impl.cc (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/browser/ren...
content/browser/renderer_host/render_view_host_impl.cc:725: const
content::SelectedFileInfo& file = files[i];
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: content:: not needed since you're already in the content namespace. also
> above

Done.

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/browser/ren...
File content/browser/renderer_host/render_view_host_impl.h (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/browser/ren...
content/browser/renderer_host/render_view_host_impl.h:22: #include
"content/public/common/selected_file_info.h"
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: forward declare

Done.

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/public/brow...
File content/public/browser/render_view_host.h (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/public/brow...
content/public/browser/render_view_host.h:13: #include
"content/public/common/selected_file_info.h"
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: forward declare

Done.

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/public/comm...
File content/public/common/selected_file_info.h (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/public/comm...
content/public/common/selected_file_info.h:29: SelectedFileInfo() {}
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: is this necessary?

This was needed for serialization for IPC to work.

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/renderer/re...
File content/renderer/render_view_impl.h (right):

https://chromiumcodereview.appspot.com/9651028/diff/14005/content/renderer/re...
content/renderer/render_view_impl.h:31: #include
"content/public/common/selected_file_info.h"
On 2012/03/14 00:47:01, John Abd-El-Malek wrote:
> nit: forward declare instead

Done.

Powered by Google App Engine
This is Rietveld 408576698