| 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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 943 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
| 944 OnDidContentsPreferredSizeChange) | 944 OnDidContentsPreferredSizeChange) |
| 945 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, | 945 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, |
| 946 OnRouteCloseEvent) | 946 OnRouteCloseEvent) |
| 947 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) | 947 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) |
| 948 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 948 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
| 949 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 949 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
| 950 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 950 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
| 951 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) | 951 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) |
| 952 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) | 952 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) |
| 953 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorIsOneChanged, | |
| 954 OnPageScaleFactorIsOneChanged) | |
| 955 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) | 953 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) |
| 956 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) | 954 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) |
| 957 // Have the super handle all other messages. | 955 // Have the super handle all other messages. |
| 958 IPC_MESSAGE_UNHANDLED( | 956 IPC_MESSAGE_UNHANDLED( |
| 959 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) | 957 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) |
| 960 IPC_END_MESSAGE_MAP() | 958 IPC_END_MESSAGE_MAP() |
| 961 | 959 |
| 962 return handled; | 960 return handled; |
| 963 } | 961 } |
| 964 | 962 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1375 const GURL& url) { | 1373 const GURL& url) { |
| 1376 HostZoomMapImpl* host_zoom_map = | 1374 HostZoomMapImpl* host_zoom_map = |
| 1377 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); | 1375 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); |
| 1378 | 1376 |
| 1379 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), | 1377 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), |
| 1380 GetRoutingID(), | 1378 GetRoutingID(), |
| 1381 zoom_level, | 1379 zoom_level, |
| 1382 net::GetHostOrSpecFromURL(url)); | 1380 net::GetHostOrSpecFromURL(url)); |
| 1383 } | 1381 } |
| 1384 | 1382 |
| 1385 void RenderViewHostImpl::OnPageScaleFactorIsOneChanged(bool is_one) { | |
| 1386 if (!GetSiteInstance()) | |
| 1387 return; | |
| 1388 HostZoomMapImpl* host_zoom_map = | |
| 1389 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); | |
| 1390 if (!host_zoom_map) | |
| 1391 return; | |
| 1392 if (!GetProcess()) | |
| 1393 return; | |
| 1394 host_zoom_map->SetPageScaleFactorIsOneForView(GetProcess()->GetID(), | |
| 1395 GetRoutingID(), is_one); | |
| 1396 } | |
| 1397 | |
| 1398 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { | 1383 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { |
| 1399 // Do not allow messages with absolute paths in them as this can permit a | 1384 // Do not allow messages with absolute paths in them as this can permit a |
| 1400 // renderer to coerce the browser to perform I/O on a renderer controlled | 1385 // renderer to coerce the browser to perform I/O on a renderer controlled |
| 1401 // path. | 1386 // path. |
| 1402 if (params.default_file_name != params.default_file_name.BaseName()) { | 1387 if (params.default_file_name != params.default_file_name.BaseName()) { |
| 1403 bad_message::ReceivedBadMessage(GetProcess(), | 1388 bad_message::ReceivedBadMessage(GetProcess(), |
| 1404 bad_message::RVH_FILE_CHOOSER_PATH); | 1389 bad_message::RVH_FILE_CHOOSER_PATH); |
| 1405 return; | 1390 return; |
| 1406 } | 1391 } |
| 1407 | 1392 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 } else { | 1444 } else { |
| 1460 render_view_ready_on_process_launch_ = true; | 1445 render_view_ready_on_process_launch_ = true; |
| 1461 } | 1446 } |
| 1462 } | 1447 } |
| 1463 | 1448 |
| 1464 void RenderViewHostImpl::RenderViewReady() { | 1449 void RenderViewHostImpl::RenderViewReady() { |
| 1465 delegate_->RenderViewReady(this); | 1450 delegate_->RenderViewReady(this); |
| 1466 } | 1451 } |
| 1467 | 1452 |
| 1468 } // namespace content | 1453 } // namespace content |
| OLD | NEW |