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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2446743002: Remove WebFileChooserParams::initialValue (Closed)
Patch Set: Split test into own file; const sprinkles Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 3ff49b1889d976d705b22f75d808ab38f8739272..4eb8faa2c1cc3f0a1d103414c787c18f91bcc1ef 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2332,6 +2332,11 @@ bool RenderFrameImpl::ScheduleFileChooser(
const FileChooserParams& params,
blink::WebFileChooserCompletion* completion) {
static const size_t kMaximumPendingFileChooseRequests = 4;
+
+ // Do not open the file dialog in a hidden RenderFrame.
+ if (IsHidden())
+ return false;
+
if (file_chooser_completions_.size() > kMaximumPendingFileChooseRequests) {
// This sanity check prevents too many file choose requests from getting
// queued which could DoS the user. Getting these is most likely a
@@ -4018,9 +4023,6 @@ bool RenderFrameImpl::runModalBeforeUnloadDialog(bool is_reload) {
bool RenderFrameImpl::runFileChooser(
const blink::WebFileChooserParams& params,
blink::WebFileChooserCompletion* chooser_completion) {
- // Do not open the file dialog in a hidden RenderFrame.
- if (IsHidden())
- return false;
FileChooserParams ipc_params;
if (params.directory)
@@ -4032,8 +4034,6 @@ bool RenderFrameImpl::runFileChooser(
else
ipc_params.mode = FileChooserParams::Open;
ipc_params.title = params.title;
- ipc_params.default_file_name =
- blink::WebStringToFilePath(params.initialValue).BaseName();
ipc_params.accept_types.reserve(params.acceptTypes.size());
for (const auto& type : params.acceptTypes)
ipc_params.accept_types.push_back(type);
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698