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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 HostZoomMapImpl* host_zoom_map = | 1388 HostZoomMapImpl* host_zoom_map = |
1389 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); | 1389 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); |
1390 | 1390 |
1391 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), | 1391 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), |
1392 GetRoutingID(), | 1392 GetRoutingID(), |
1393 zoom_level, | 1393 zoom_level, |
1394 net::GetHostOrSpecFromURL(url)); | 1394 net::GetHostOrSpecFromURL(url)); |
1395 } | 1395 } |
1396 | 1396 |
1397 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { | 1397 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { |
| 1398 // Do not allow messages with absolute paths in them as this can permit a |
| 1399 // renderer to coerce the browser to perform I/O on a renderer controlled |
| 1400 // path. |
| 1401 if (params.default_file_name != params.default_file_name.BaseName()) { |
| 1402 GetProcess()->ReceivedBadMessage(); |
| 1403 return; |
| 1404 } |
| 1405 |
1398 delegate_->RunFileChooser(this, params); | 1406 delegate_->RunFileChooser(this, params); |
1399 } | 1407 } |
1400 | 1408 |
1401 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { | 1409 void RenderViewHostImpl::OnFocusedNodeTouched(bool editable) { |
1402 #if defined(OS_WIN) | 1410 #if defined(OS_WIN) |
1403 if (editable) { | 1411 if (editable) { |
1404 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); | 1412 virtual_keyboard_requested_ = base::win::DisplayVirtualKeyboard(); |
1405 delegate_->SetIsVirtualKeyboardRequested(true); | 1413 delegate_->SetIsVirtualKeyboardRequested(true); |
1406 } else { | 1414 } else { |
1407 virtual_keyboard_requested_ = false; | 1415 virtual_keyboard_requested_ = false; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1447 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1440 | 1448 |
1441 frame_tree->ResetForMainFrameSwap(); | 1449 frame_tree->ResetForMainFrameSwap(); |
1442 } | 1450 } |
1443 | 1451 |
1444 void RenderViewHostImpl::SelectWordAroundCaret() { | 1452 void RenderViewHostImpl::SelectWordAroundCaret() { |
1445 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1453 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1446 } | 1454 } |
1447 | 1455 |
1448 } // namespace content | 1456 } // namespace content |
OLD | NEW |