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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2374863002: Remove usage of HostZoomMap from c/b/loader via ReadyToCommitNavigation (Closed)
Patch Set: init Created 4 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 } 1309 }
1310 1310
1311 bool handled = true; 1311 bool handled = true;
1312 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) 1312 IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
1313 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand) 1313 IPC_MESSAGE_HANDLER(InputMsg_ExecuteEditCommand, OnExecuteEditCommand)
1314 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret) 1314 IPC_MESSAGE_HANDLER(InputMsg_MoveCaret, OnMoveCaret)
1315 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect, 1315 IPC_MESSAGE_HANDLER(InputMsg_ScrollFocusedEditableNodeIntoRect,
1316 OnScrollFocusedEditableNodeIntoRect) 1316 OnScrollFocusedEditableNodeIntoRect)
1317 IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale) 1317 IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale)
1318 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) 1318 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
1319 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
1320 OnSetZoomLevelForLoadingURL)
1321 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) 1319 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter)
1322 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) 1320 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver)
1323 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) 1321 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave)
1324 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) 1322 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop)
1325 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) 1323 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded)
1326 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, 1324 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded,
1327 OnDragSourceSystemDragEnded) 1325 OnDragSourceSystemDragEnded)
1328 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) 1326 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings)
1329 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) 1327 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
1330 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) 1328 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 zoom_level = static_cast<int>(old_zoom_level + zoom); 2235 zoom_level = static_cast<int>(old_zoom_level + zoom);
2238 } else { 2236 } else {
2239 // We're going towards 100%, so first go to the next whole number. 2237 // We're going towards 100%, so first go to the next whole number.
2240 zoom_level = static_cast<int>(old_zoom_level); 2238 zoom_level = static_cast<int>(old_zoom_level);
2241 } 2239 }
2242 } 2240 }
2243 SetZoomLevel(zoom_level); 2241 SetZoomLevel(zoom_level);
2244 zoomLevelChanged(); 2242 zoomLevelChanged();
2245 } 2243 }
2246 2244
2247 void RenderViewImpl::OnSetZoomLevelForLoadingURL(const GURL& url,
2248 double zoom_level) {
2249 // TODO(wjmaclean): We should see if this restriction is really necessary,
2250 // since it isn't enforced in other parts of the page zoom system (e.g.
2251 // when a users changes the zoom of a currently displayed page). Android
2252 // has no UI for this, so in theory the following code would normally just use
2253 // the default zoom anyways.
2254 #if !defined(OS_ANDROID)
2255 // On Android, page zoom isn't used, and in case of WebView, text zoom is used
2256 // for legacy WebView text scaling emulation. Thus, the code that resets
2257 // the zoom level from this map will be effectively resetting text zoom level.
2258 host_zoom_levels_[url] = zoom_level;
2259 #endif
2260 }
2261
2262 void RenderViewImpl::OnSetZoomLevel( 2245 void RenderViewImpl::OnSetZoomLevel(
2263 PageMsg_SetZoomLevel_Command command, 2246 PageMsg_SetZoomLevel_Command command,
2264 double zoom_level) { 2247 double zoom_level) {
2265 switch (command) { 2248 switch (command) {
2266 case PageMsg_SetZoomLevel_Command::CLEAR_TEMPORARY: 2249 case PageMsg_SetZoomLevel_Command::CLEAR_TEMPORARY:
2267 uses_temporary_zoom_level_ = false; 2250 uses_temporary_zoom_level_ = false;
2268 break; 2251 break;
2269 case PageMsg_SetZoomLevel_Command::SET_TEMPORARY: 2252 case PageMsg_SetZoomLevel_Command::SET_TEMPORARY:
2270 uses_temporary_zoom_level_ = true; 2253 uses_temporary_zoom_level_ = true;
2271 break; 2254 break;
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
3031 if (IsUseZoomForDSFEnabled()) { 3014 if (IsUseZoomForDSFEnabled()) {
3032 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3015 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3033 } else { 3016 } else {
3034 webview()->setDeviceScaleFactor(device_scale_factor_); 3017 webview()->setDeviceScaleFactor(device_scale_factor_);
3035 } 3018 }
3036 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3019 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3037 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3020 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3038 } 3021 }
3039 3022
3040 } // namespace content 3023 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698