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

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

Issue 2894043002: Add machinery to show touch editing context menus in OOPIFs. (Closed)
Patch Set: Add DCHECK, rebase test. Created 3 years, 6 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/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 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, 1223 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode,
1224 OnEnablePreferredSizeChangedMode) 1224 OnEnablePreferredSizeChangedMode)
1225 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) 1225 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize)
1226 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) 1226 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize)
1227 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, 1227 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows,
1228 OnDisableScrollbarsForSmallWindows) 1228 OnDisableScrollbarsForSmallWindows)
1229 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) 1229 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs)
1230 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) 1230 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt)
1231 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) 1231 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt)
1232 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) 1232 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
1233 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu)
1234 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, 1233 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap,
1235 OnReleaseDisambiguationPopupBitmap) 1234 OnReleaseDisambiguationPopupBitmap)
1236 IPC_MESSAGE_HANDLER(ViewMsg_ResolveTapDisambiguation, 1235 IPC_MESSAGE_HANDLER(ViewMsg_ResolveTapDisambiguation,
1237 OnResolveTapDisambiguation) 1236 OnResolveTapDisambiguation)
1238 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) 1237 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
1239 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) 1238 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
1240 1239
1241 // Page messages. 1240 // Page messages.
1242 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect, 1241 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect,
1243 OnUpdateWindowScreenRect) 1242 OnUpdateWindowScreenRect)
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 date_time_picker_client_.reset( 2396 date_time_picker_client_.reset(
2398 new RendererDateTimePicker(this, params, completion)); 2397 new RendererDateTimePicker(this, params, completion));
2399 return date_time_picker_client_->Open(); 2398 return date_time_picker_client_->Open();
2400 } 2399 }
2401 2400
2402 void RenderViewImpl::DismissDateTimeDialog() { 2401 void RenderViewImpl::DismissDateTimeDialog() {
2403 DCHECK(date_time_picker_client_); 2402 DCHECK(date_time_picker_client_);
2404 date_time_picker_client_.reset(NULL); 2403 date_time_picker_client_.reset(NULL);
2405 } 2404 }
2406 2405
2407 #endif // defined(OS_ANDROID)
2408
2409 void RenderViewImpl::OnShowContextMenu(
2410 ui::MenuSourceType source_type, const gfx::Point& location) {
2411 input_handler_->set_context_menu_source_type(source_type);
2412 has_host_context_menu_location_ = true;
2413 host_context_menu_location_ = location;
2414 if (webview())
2415 webview()->ShowContextMenu(
2416 static_cast<blink::WebMenuSourceType>(source_type));
2417 has_host_context_menu_location_ = false;
2418 }
2419
2420 #if defined(OS_ANDROID)
2421 bool RenderViewImpl::DidTapMultipleTargets( 2406 bool RenderViewImpl::DidTapMultipleTargets(
2422 const WebSize& inner_viewport_offset, 2407 const WebSize& inner_viewport_offset,
2423 const WebRect& touch_rect, 2408 const WebRect& touch_rect,
2424 const WebVector<WebRect>& target_rects) { 2409 const WebVector<WebRect>& target_rects) {
2425 // Never show a disambiguation popup when accessibility is enabled, 2410 // Never show a disambiguation popup when accessibility is enabled,
2426 // as this interferes with "touch exploration". 2411 // as this interferes with "touch exploration".
2427 AccessibilityMode accessibility_mode = 2412 AccessibilityMode accessibility_mode =
2428 GetMainRenderFrame()->accessibility_mode(); 2413 GetMainRenderFrame()->accessibility_mode();
2429 if (accessibility_mode == kAccessibilityModeComplete) 2414 if (accessibility_mode == kAccessibilityModeComplete)
2430 return false; 2415 return false;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 input_event.GetCoalescedEventsPointers(), latency_info, 2654 input_event.GetCoalescedEventsPointers(), latency_info,
2670 dispatch_type); 2655 dispatch_type);
2671 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; 2656 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
2672 } 2657 }
2673 idle_user_detector_->ActivityDetected(); 2658 idle_user_detector_->ActivityDetected();
2674 return RenderWidget::HandleInputEvent(input_event, latency_info, 2659 return RenderWidget::HandleInputEvent(input_event, latency_info,
2675 dispatch_type); 2660 dispatch_type);
2676 } 2661 }
2677 2662
2678 } // namespace content 2663 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698