Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 1408393003: Propagate pageScaleFactor to GuestViews (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant initialization of AwLayoutSizer's page scale factor in tests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, 958 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
959 OnDidContentsPreferredSizeChange) 959 OnDidContentsPreferredSizeChange)
960 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, 960 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent,
961 OnRouteCloseEvent) 961 OnRouteCloseEvent)
962 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) 962 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging)
963 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) 963 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
964 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 964 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
965 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) 965 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
966 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) 966 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
967 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) 967 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL)
968 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorIsOneChanged,
969 OnPageScaleFactorIsOneChanged)
970 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) 968 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
971 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) 969 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
972 // Have the super handle all other messages. 970 // Have the super handle all other messages.
973 IPC_MESSAGE_UNHANDLED( 971 IPC_MESSAGE_UNHANDLED(
974 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) 972 handled = RenderWidgetHostImpl::OnMessageReceived(msg))
975 IPC_END_MESSAGE_MAP() 973 IPC_END_MESSAGE_MAP()
976 974
977 return handled; 975 return handled;
978 } 976 }
979 977
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 const GURL& url) { 1386 const GURL& url) {
1389 HostZoomMapImpl* host_zoom_map = 1387 HostZoomMapImpl* host_zoom_map =
1390 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); 1388 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1391 1389
1392 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), 1390 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(),
1393 GetRoutingID(), 1391 GetRoutingID(),
1394 zoom_level, 1392 zoom_level,
1395 net::GetHostOrSpecFromURL(url)); 1393 net::GetHostOrSpecFromURL(url));
1396 } 1394 }
1397 1395
1398 void RenderViewHostImpl::OnPageScaleFactorIsOneChanged(bool is_one) {
1399 if (!GetSiteInstance())
1400 return;
1401 HostZoomMapImpl* host_zoom_map =
1402 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1403 if (!host_zoom_map)
1404 return;
1405 if (!GetProcess())
1406 return;
1407 host_zoom_map->SetPageScaleFactorIsOneForView(GetProcess()->GetID(),
1408 GetRoutingID(), is_one);
1409 }
1410
1411 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { 1396 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
1412 // Do not allow messages with absolute paths in them as this can permit a 1397 // Do not allow messages with absolute paths in them as this can permit a
1413 // renderer to coerce the browser to perform I/O on a renderer controlled 1398 // renderer to coerce the browser to perform I/O on a renderer controlled
1414 // path. 1399 // path.
1415 if (params.default_file_name != params.default_file_name.BaseName()) { 1400 if (params.default_file_name != params.default_file_name.BaseName()) {
1416 bad_message::ReceivedBadMessage(GetProcess(), 1401 bad_message::ReceivedBadMessage(GetProcess(),
1417 bad_message::RVH_FILE_CHOOSER_PATH); 1402 bad_message::RVH_FILE_CHOOSER_PATH);
1418 return; 1403 return;
1419 } 1404 }
1420 1405
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 } else { 1457 } else {
1473 render_view_ready_on_process_launch_ = true; 1458 render_view_ready_on_process_launch_ = true;
1474 } 1459 }
1475 } 1460 }
1476 1461
1477 void RenderViewHostImpl::RenderViewReady() { 1462 void RenderViewHostImpl::RenderViewReady() {
1478 delegate_->RenderViewReady(this); 1463 delegate_->RenderViewReady(this);
1479 } 1464 }
1480 1465
1481 } // namespace content 1466 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698