| 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 c2b058414bca4b3b6057ddfb37cef3ec8558145d..5ef6ab259980b99a3abc20da558e1cff2c5075cf 100644
|
| --- a/content/browser/renderer_host/render_view_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_view_host_impl.cc
|
| @@ -834,12 +834,17 @@ void RenderViewHostImpl::SetInitialFocus(bool reverse) {
|
|
|
| void RenderViewHostImpl::FilesSelectedInChooser(
|
| const std::vector<ui::SelectedFileInfo>& files,
|
| - int permissions) {
|
| + FileChooserParams::Mode 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 == FileChooserParams::Save) {
|
| + ChildProcessSecurityPolicyImpl::GetInstance()->GrantCreateWriteFile(
|
| + GetProcess()->GetID(), file.local_path);
|
| + } else {
|
| + ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
|
| + GetProcess()->GetID(), file.local_path);
|
| + }
|
| }
|
| Send(new ViewMsg_RunFileChooserResponse(GetRoutingID(), files));
|
| }
|
|
|