| 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 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 float scale = GetScaleFactorForView(GetWidget()->GetView()); | 1239 float scale = GetScaleFactorForView(GetWidget()->GetView()); |
| 1240 gfx::Point location_dips_screen = | 1240 gfx::Point location_dips_screen = |
| 1241 gfx::ConvertPointToDIP(scale, gfx::Point(cursor_pos)); | 1241 gfx::ConvertPointToDIP(scale, gfx::Point(cursor_pos)); |
| 1242 if (GetWidget()->GetView()) | 1242 if (GetWidget()->GetView()) |
| 1243 GetWidget()->GetView()->FocusedNodeTouched(location_dips_screen, editable); | 1243 GetWidget()->GetView()->FocusedNodeTouched(location_dips_screen, editable); |
| 1244 #endif | 1244 #endif |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 bool RenderViewHostImpl::CanAccessFilesOfPageState( | 1247 bool RenderViewHostImpl::CanAccessFilesOfPageState( |
| 1248 const PageState& state) const { | 1248 const PageState& state) const { |
| 1249 ChildProcessSecurityPolicyImpl* policy = | 1249 return ChildProcessSecurityPolicyImpl::GetInstance()->CanReadAllFiles( |
| 1250 ChildProcessSecurityPolicyImpl::GetInstance(); | 1250 GetProcess()->GetID(), state.GetReferencedFiles()); |
| 1251 | |
| 1252 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | |
| 1253 for (const auto& file : file_paths) { | |
| 1254 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | |
| 1255 return false; | |
| 1256 } | |
| 1257 return true; | |
| 1258 } | 1251 } |
| 1259 | 1252 |
| 1260 void RenderViewHostImpl::GrantFileAccessFromPageState(const PageState& state) { | 1253 void RenderViewHostImpl::GrantFileAccessFromPageState(const PageState& state) { |
| 1261 ChildProcessSecurityPolicyImpl* policy = | 1254 ChildProcessSecurityPolicyImpl* policy = |
| 1262 ChildProcessSecurityPolicyImpl::GetInstance(); | 1255 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 1263 | 1256 |
| 1264 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | 1257 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); |
| 1265 for (const auto& file : file_paths) { | 1258 for (const auto& file : file_paths) { |
| 1266 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1259 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
| 1267 policy->GrantReadFile(GetProcess()->GetID(), file); | 1260 policy->GrantReadFile(GetProcess()->GetID(), file); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1282 } else { | 1275 } else { |
| 1283 render_view_ready_on_process_launch_ = true; | 1276 render_view_ready_on_process_launch_ = true; |
| 1284 } | 1277 } |
| 1285 } | 1278 } |
| 1286 | 1279 |
| 1287 void RenderViewHostImpl::RenderViewReady() { | 1280 void RenderViewHostImpl::RenderViewReady() { |
| 1288 delegate_->RenderViewReady(this); | 1281 delegate_->RenderViewReady(this); |
| 1289 } | 1282 } |
| 1290 | 1283 |
| 1291 } // namespace content | 1284 } // namespace content |
| OLD | NEW |