| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 WebDragOperationsMask operations_allowed, | 826 WebDragOperationsMask operations_allowed, |
| 827 int key_modifiers) { | 827 int key_modifiers) { |
| 828 const int renderer_id = GetProcess()->GetID(); | 828 const int renderer_id = GetProcess()->GetID(); |
| 829 ChildProcessSecurityPolicyImpl* policy = | 829 ChildProcessSecurityPolicyImpl* policy = |
| 830 ChildProcessSecurityPolicyImpl::GetInstance(); | 830 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 831 | 831 |
| 832 // The URL could have been cobbled together from any highlighted text string, | 832 // The URL could have been cobbled together from any highlighted text string, |
| 833 // and can't be interpreted as a capability. | 833 // and can't be interpreted as a capability. |
| 834 DropData filtered_data(drop_data); | 834 DropData filtered_data(drop_data); |
| 835 GetProcess()->FilterURL(true, &filtered_data.url); | 835 GetProcess()->FilterURL(true, &filtered_data.url); |
| 836 if (drop_data.did_originate_from_renderer) { |
| 837 filtered_data.filenames.clear(); |
| 838 } |
| 836 | 839 |
| 837 // The filenames vector, on the other hand, does represent a capability to | 840 // The filenames vector, on the other hand, does represent a capability to |
| 838 // access the given files. | 841 // access the given files. |
| 839 fileapi::IsolatedContext::FileInfoSet files; | 842 fileapi::IsolatedContext::FileInfoSet files; |
| 840 for (std::vector<DropData::FileInfo>::iterator iter( | 843 for (std::vector<DropData::FileInfo>::iterator iter( |
| 841 filtered_data.filenames.begin()); | 844 filtered_data.filenames.begin()); |
| 842 iter != filtered_data.filenames.end(); ++iter) { | 845 iter != filtered_data.filenames.end(); ++iter) { |
| 843 // A dragged file may wind up as the value of an input element, or it | 846 // A dragged file may wind up as the value of an input element, or it |
| 844 // may be used as the target of a navigation instead. We don't know | 847 // may be used as the target of a navigation instead. We don't know |
| 845 // which will happen at this point, so generously grant both access | 848 // which will happen at this point, so generously grant both access |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 void RenderViewHostImpl::AttachToFrameTree() { | 2087 void RenderViewHostImpl::AttachToFrameTree() { |
| 2085 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2088 FrameTree* frame_tree = delegate_->GetFrameTree(); |
| 2086 | 2089 |
| 2087 frame_tree->ResetForMainFrameSwap(); | 2090 frame_tree->ResetForMainFrameSwap(); |
| 2088 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2091 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
| 2089 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2092 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
| 2090 } | 2093 } |
| 2091 } | 2094 } |
| 2092 | 2095 |
| 2093 } // namespace content | 2096 } // namespace content |
| OLD | NEW |