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

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

Powered by Google App Engine
This is Rietveld 408576698