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

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

Issue 954923005: Make command-zero reset page scale in addition to zoom level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again again Created 5 years, 9 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, 866 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent,
867 OnRouteCloseEvent) 867 OnRouteCloseEvent)
868 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) 868 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent)
869 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) 869 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging)
870 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) 870 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
871 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) 871 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK)
872 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 872 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
873 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) 873 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
874 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) 874 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
875 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) 875 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL)
876 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorIsOneChanged,
877 OnPageScaleFactorIsOneChanged)
876 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser) 878 IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
877 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched) 879 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeTouched, OnFocusedNodeTouched)
878 // Have the super handle all other messages. 880 // Have the super handle all other messages.
879 IPC_MESSAGE_UNHANDLED( 881 IPC_MESSAGE_UNHANDLED(
880 handled = RenderWidgetHostImpl::OnMessageReceived(msg)) 882 handled = RenderWidgetHostImpl::OnMessageReceived(msg))
881 IPC_END_MESSAGE_MAP() 883 IPC_END_MESSAGE_MAP()
882 884
883 return handled; 885 return handled;
884 } 886 }
885 887
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 const GURL& url) { 1343 const GURL& url) {
1342 HostZoomMapImpl* host_zoom_map = 1344 HostZoomMapImpl* host_zoom_map =
1343 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); 1345 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1344 1346
1345 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(), 1347 host_zoom_map->SetZoomLevelForView(GetProcess()->GetID(),
1346 GetRoutingID(), 1348 GetRoutingID(),
1347 zoom_level, 1349 zoom_level,
1348 net::GetHostOrSpecFromURL(url)); 1350 net::GetHostOrSpecFromURL(url));
1349 } 1351 }
1350 1352
1353 void RenderViewHostImpl::OnPageScaleFactorIsOneChanged(bool is_one) {
1354 if (!GetSiteInstance())
1355 return;
1356 HostZoomMapImpl* host_zoom_map =
1357 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance()));
1358 if (!host_zoom_map)
1359 return;
1360 if (!GetProcess())
1361 return;
1362 host_zoom_map->SetPageScaleFactorIsOneForView(GetProcess()->GetID(),
1363 GetRoutingID(), is_one);
1364 }
1365
1351 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) { 1366 void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
1352 // Do not allow messages with absolute paths in them as this can permit a 1367 // Do not allow messages with absolute paths in them as this can permit a
1353 // renderer to coerce the browser to perform I/O on a renderer controlled 1368 // renderer to coerce the browser to perform I/O on a renderer controlled
1354 // path. 1369 // path.
1355 if (params.default_file_name != params.default_file_name.BaseName()) { 1370 if (params.default_file_name != params.default_file_name.BaseName()) {
1356 GetProcess()->ReceivedBadMessage(); 1371 GetProcess()->ReceivedBadMessage();
1357 return; 1372 return;
1358 } 1373 }
1359 1374
1360 delegate_->RunFileChooser(this, params); 1375 delegate_->RunFileChooser(this, params);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 FrameTree* frame_tree = delegate_->GetFrameTree(); 1416 FrameTree* frame_tree = delegate_->GetFrameTree();
1402 1417
1403 frame_tree->ResetForMainFrameSwap(); 1418 frame_tree->ResetForMainFrameSwap();
1404 } 1419 }
1405 1420
1406 void RenderViewHostImpl::SelectWordAroundCaret() { 1421 void RenderViewHostImpl::SelectWordAroundCaret() {
1407 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1422 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1408 } 1423 }
1409 1424
1410 } // namespace content 1425 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698