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 83729afb8191f52196cd636d9d02df87d551fa03..19f513ebaff0fe8eef5e83239b750c5d057a29f0 100644 |
--- a/content/browser/renderer_host/render_view_host_impl.cc |
+++ b/content/browser/renderer_host/render_view_host_impl.cc |
@@ -834,12 +834,18 @@ void RenderViewHostImpl::SetInitialFocus(bool reverse) { |
void RenderViewHostImpl::FilesSelectedInChooser( |
const std::vector<ui::SelectedFileInfo>& files, |
- int permissions) { |
+ RenderViewHost::FileSelectionPermissions permissions) { |
// Grant the security access requested to the given files. |
for (size_t i = 0; i < files.size(); ++i) { |
const ui::SelectedFileInfo& file = files[i]; |
- ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( |
- GetProcess()->GetID(), file.local_path, permissions); |
+ if (permissions == RenderViewHost::FILE_PERMISSION_READ_ONLY) { |
+ ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
+ GetProcess()->GetID(), file.local_path); |
+ } |
+ if (permissions == RenderViewHost::FILE_PERMISSION_WRITE) { |
+ ChildProcessSecurityPolicyImpl::GetInstance()->GrantCreateWriteFile( |
+ GetProcess()->GetID(), file.local_path); |
+ } |
} |
Send(new ViewMsg_RunFileChooserResponse(GetRoutingID(), files)); |
} |