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/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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, | 1368 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, |
1369 OnDisableScrollbarsForSmallWindows) | 1369 OnDisableScrollbarsForSmallWindows) |
1370 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 1370 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
1371 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) | 1371 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) |
1372 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) | 1372 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) |
1373 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) | 1373 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) |
1374 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) | 1374 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) |
1375 // TODO(viettrungluu): Move to a separate message filter. | 1375 // TODO(viettrungluu): Move to a separate message filter. |
1376 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryOffsetAndLength, | 1376 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryOffsetAndLength, |
1377 OnSetHistoryOffsetAndLength) | 1377 OnSetHistoryOffsetAndLength) |
1378 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | |
1379 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, | 1378 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, |
1380 OnReleaseDisambiguationPopupBitmap) | 1379 OnReleaseDisambiguationPopupBitmap) |
1381 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) | 1380 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) |
1382 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) | 1381 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) |
1383 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect, | 1382 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect, |
1384 OnUpdateWindowScreenRect) | 1383 OnUpdateWindowScreenRect) |
1385 #if defined(OS_ANDROID) | 1384 #if defined(OS_ANDROID) |
1386 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, | 1385 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, |
1387 OnUpdateTopControlsState) | 1386 OnUpdateTopControlsState) |
1388 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) | 1387 IPC_MESSAGE_HANDLER(ViewMsg_ExtractSmartClipData, OnExtractSmartClipData) |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3248 void RenderViewImpl::OnShowContextMenu( | 3247 void RenderViewImpl::OnShowContextMenu( |
3249 ui::MenuSourceType source_type, const gfx::Point& location) { | 3248 ui::MenuSourceType source_type, const gfx::Point& location) { |
3250 input_handler_->set_context_menu_source_type(source_type); | 3249 input_handler_->set_context_menu_source_type(source_type); |
3251 has_host_context_menu_location_ = true; | 3250 has_host_context_menu_location_ = true; |
3252 host_context_menu_location_ = location; | 3251 host_context_menu_location_ = location; |
3253 if (webview()) | 3252 if (webview()) |
3254 webview()->showContextMenu(); | 3253 webview()->showContextMenu(); |
3255 has_host_context_menu_location_ = false; | 3254 has_host_context_menu_location_ = false; |
3256 } | 3255 } |
3257 | 3256 |
3258 void RenderViewImpl::OnEnableViewSourceMode() { | |
3259 if (!webview()) | |
3260 return; | |
3261 WebFrame* main_frame = webview()->mainFrame(); | |
3262 if (!main_frame) | |
3263 return; | |
3264 main_frame->enableViewSourceMode(true); | |
3265 } | |
3266 | |
3267 #if defined(OS_ANDROID) || defined(USE_AURA) | 3257 #if defined(OS_ANDROID) || defined(USE_AURA) |
3268 bool RenderViewImpl::didTapMultipleTargets( | 3258 bool RenderViewImpl::didTapMultipleTargets( |
3269 const WebSize& inner_viewport_offset, | 3259 const WebSize& inner_viewport_offset, |
3270 const WebRect& touch_rect, | 3260 const WebRect& touch_rect, |
3271 const WebVector<WebRect>& target_rects) { | 3261 const WebVector<WebRect>& target_rects) { |
3272 DCHECK(switches::IsLinkDisambiguationPopupEnabled()); | 3262 DCHECK(switches::IsLinkDisambiguationPopupEnabled()); |
3273 | 3263 |
3274 // Never show a disambiguation popup when accessibility is enabled, | 3264 // Never show a disambiguation popup when accessibility is enabled, |
3275 // as this interferes with "touch exploration". | 3265 // as this interferes with "touch exploration". |
3276 AccessibilityMode accessibility_mode = | 3266 AccessibilityMode accessibility_mode = |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3453 if (IsUseZoomForDSFEnabled()) { | 3443 if (IsUseZoomForDSFEnabled()) { |
3454 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3444 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
3455 } else { | 3445 } else { |
3456 webview()->setDeviceScaleFactor(device_scale_factor_); | 3446 webview()->setDeviceScaleFactor(device_scale_factor_); |
3457 } | 3447 } |
3458 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3448 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
3459 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3449 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
3460 } | 3450 } |
3461 | 3451 |
3462 } // namespace content | 3452 } // namespace content |
OLD | NEW |