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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2050623005: Move file chooser from RenderView(Host) to RenderFrame(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on reviews. Created 4 years, 6 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/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 075b3f8aa96c8da369ca3f39d9ebe75997bdc935..84d790eabf8db891f818da53fe9f0021fc594714 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -777,33 +777,6 @@ void RenderViewHostImpl::SetInitialFocus(bool reverse) {
Send(new ViewMsg_SetInitialFocus(GetRoutingID(), reverse));
}
-void RenderViewHostImpl::FilesSelectedInChooser(
- const std::vector<content::FileChooserFileInfo>& files,
- FileChooserParams::Mode permissions) {
- storage::FileSystemContext* const file_system_context =
- BrowserContext::GetStoragePartition(GetProcess()->GetBrowserContext(),
- GetSiteInstance())
- ->GetFileSystemContext();
- // Grant the security access requested to the given files.
- for (size_t i = 0; i < files.size(); ++i) {
- const content::FileChooserFileInfo& file = files[i];
- if (permissions == FileChooserParams::Save) {
- ChildProcessSecurityPolicyImpl::GetInstance()->GrantCreateReadWriteFile(
- GetProcess()->GetID(), file.file_path);
- } else {
- ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
- GetProcess()->GetID(), file.file_path);
- }
- if (file.file_system_url.is_valid()) {
- ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFileSystem(
- GetProcess()->GetID(),
- file_system_context->CrackURL(file.file_system_url)
- .mount_filesystem_id());
- }
- }
- Send(new ViewMsg_RunFileChooserResponse(GetRoutingID(), files));
-}
-
void RenderViewHostImpl::DirectoryEnumerationFinished(
int request_id,
const std::vector<base::FilePath>& files) {
@@ -891,7 +864,6 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL)
- IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -1253,19 +1225,6 @@ void RenderViewHostImpl::OnDidZoomURL(double zoom_level,
net::GetHostOrSpecFromURL(url));
}
-void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
- // Do not allow messages with absolute paths in them as this can permit a
- // renderer to coerce the browser to perform I/O on a renderer controlled
- // path.
- if (params.default_file_name != params.default_file_name.BaseName()) {
- bad_message::ReceivedBadMessage(GetProcess(),
- bad_message::RVH_FILE_CHOOSER_PATH);
- return;
- }
-
- delegate_->RunFileChooser(this, params);
-}
-
void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) {
#if defined(OS_WIN)
// We use the cursor position to determine where the touch occurred.
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/security_exploit_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698