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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2446743002: Remove WebFileChooserParams::initialValue (Closed)
Patch Set: Remove defaultName from blink API 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 3a26bb55bf5c717fe77f9e30ebd92979c8be6e6f..10c1fb9512496e5586ae736e0b465466d5917722 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);

Powered by Google App Engine
This is Rietveld 408576698