OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... | |
36 #include "core/InputTypeNames.h" | 36 #include "core/InputTypeNames.h" |
37 #include "core/clipboard/DataObject.h" | 37 #include "core/clipboard/DataObject.h" |
38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
39 #include "core/dom/Fullscreen.h" | 39 #include "core/dom/Fullscreen.h" |
40 #include "core/dom/LayoutTreeBuilderTraversal.h" | 40 #include "core/dom/LayoutTreeBuilderTraversal.h" |
41 #include "core/dom/Text.h" | 41 #include "core/dom/Text.h" |
42 #include "core/editing/EditingUtilities.h" | 42 #include "core/editing/EditingUtilities.h" |
43 #include "core/editing/Editor.h" | 43 #include "core/editing/Editor.h" |
44 #include "core/editing/FrameSelection.h" | 44 #include "core/editing/FrameSelection.h" |
45 #include "core/editing/InputMethodController.h" | 45 #include "core/editing/InputMethodController.h" |
46 #include "core/editing/SelectionController.h" | |
46 #include "core/editing/iterators/TextIterator.h" | 47 #include "core/editing/iterators/TextIterator.h" |
47 #include "core/editing/markers/DocumentMarkerController.h" | 48 #include "core/editing/markers/DocumentMarkerController.h" |
48 #include "core/editing/serializers/HTMLInterchange.h" | 49 #include "core/editing/serializers/HTMLInterchange.h" |
49 #include "core/editing/serializers/Serialization.h" | 50 #include "core/editing/serializers/Serialization.h" |
50 #include "core/events/KeyboardEvent.h" | 51 #include "core/events/KeyboardEvent.h" |
51 #include "core/events/UIEventWithKeyState.h" | 52 #include "core/events/UIEventWithKeyState.h" |
52 #include "core/events/WheelEvent.h" | 53 #include "core/events/WheelEvent.h" |
53 #include "core/fetch/UniqueIdentifier.h" | 54 #include "core/fetch/UniqueIdentifier.h" |
54 #include "core/frame/EventHandlerRegistry.h" | 55 #include "core/frame/EventHandlerRegistry.h" |
55 #include "core/frame/FrameHost.h" | 56 #include "core/frame/FrameHost.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 #include "platform/Logging.h" | 105 #include "platform/Logging.h" |
105 #include "platform/NotImplemented.h" | 106 #include "platform/NotImplemented.h" |
106 #include "platform/PlatformGestureEvent.h" | 107 #include "platform/PlatformGestureEvent.h" |
107 #include "platform/PlatformKeyboardEvent.h" | 108 #include "platform/PlatformKeyboardEvent.h" |
108 #include "platform/PlatformMouseEvent.h" | 109 #include "platform/PlatformMouseEvent.h" |
109 #include "platform/RuntimeEnabledFeatures.h" | 110 #include "platform/RuntimeEnabledFeatures.h" |
110 #include "platform/TraceEvent.h" | 111 #include "platform/TraceEvent.h" |
111 #include "platform/UserGestureIndicator.h" | 112 #include "platform/UserGestureIndicator.h" |
112 #include "platform/exported/WebActiveGestureAnimation.h" | 113 #include "platform/exported/WebActiveGestureAnimation.h" |
113 #include "platform/fonts/FontCache.h" | 114 #include "platform/fonts/FontCache.h" |
115 #include "platform/geometry/LayoutPoint.h" | |
114 #include "platform/graphics/Color.h" | 116 #include "platform/graphics/Color.h" |
115 #include "platform/graphics/FirstPaintInvalidationTracking.h" | 117 #include "platform/graphics/FirstPaintInvalidationTracking.h" |
116 #include "platform/graphics/GraphicsContext.h" | 118 #include "platform/graphics/GraphicsContext.h" |
117 #include "platform/graphics/Image.h" | 119 #include "platform/graphics/Image.h" |
118 #include "platform/graphics/ImageBuffer.h" | 120 #include "platform/graphics/ImageBuffer.h" |
119 #include "platform/graphics/gpu/DrawingBuffer.h" | 121 #include "platform/graphics/gpu/DrawingBuffer.h" |
120 #include "platform/graphics/paint/DrawingRecorder.h" | 122 #include "platform/graphics/paint/DrawingRecorder.h" |
121 #include "platform/scroll/ScrollbarTheme.h" | 123 #include "platform/scroll/ScrollbarTheme.h" |
122 #include "platform/weborigin/SchemeRegistry.h" | 124 #include "platform/weborigin/SchemeRegistry.h" |
123 #include "public/platform/Platform.h" | 125 #include "public/platform/Platform.h" |
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2249 if (pinchEvent.data.pinchUpdate.zoomDisabled) | 2251 if (pinchEvent.data.pinchUpdate.zoomDisabled) |
2250 return WebInputEventResult::NotHandled; | 2252 return WebInputEventResult::NotHandled; |
2251 | 2253 |
2252 if (page()->frameHost().visualViewport().magnifyScaleAroundAnchor(pinchE vent.data.pinchUpdate.scale, FloatPoint(pinchEvent.x, pinchEvent.y))) | 2254 if (page()->frameHost().visualViewport().magnifyScaleAroundAnchor(pinchE vent.data.pinchUpdate.scale, FloatPoint(pinchEvent.x, pinchEvent.y))) |
2253 return WebInputEventResult::HandledSystem; | 2255 return WebInputEventResult::HandledSystem; |
2254 } | 2256 } |
2255 | 2257 |
2256 return WebInputEventResult::NotHandled; | 2258 return WebInputEventResult::NotHandled; |
2257 } | 2259 } |
2258 | 2260 |
2261 bool WebViewImpl::selectWordIfAnyAtCoordinates(float x, float y) | |
2262 { | |
2263 IntPoint position(x, y); | |
2264 | |
2265 // Find the right target frame. See issue 1186900. | |
Rick Byers
2015/12/21 16:31:09
This comment seems to used elsewhere in android-sp
spqchan
2016/01/06 22:52:31
I removed it but I'm a bit confused by what you me
| |
2266 HitTestResult result = hitTestResultForRootFramePos(position); | |
2267 Frame* targetFrame; | |
2268 if (result.innerNodeOrImageMapImage()) | |
2269 targetFrame = result.innerNodeOrImageMapImage()->document().frame(); | |
2270 else | |
2271 targetFrame = m_page->focusController().focusedOrMainFrame(); | |
2272 | |
2273 if (!targetFrame->isLocalFrame()) | |
2274 return false; | |
2275 | |
2276 LocalFrame* localFrame = toLocalFrame(targetFrame); | |
2277 | |
2278 LayoutPoint positionInContents = mainFrameImpl()->frameView()->rootFrameToCo ntents(position); | |
2279 | |
2280 return localFrame->eventHandler().selectionController().selectWordAtPosition IfAny(flooredIntPoint(positionInContents)); | |
2281 } | |
2282 | |
2259 void WebViewImpl::setCursorVisibilityState(bool isVisible) | 2283 void WebViewImpl::setCursorVisibilityState(bool isVisible) |
2260 { | 2284 { |
2261 if (m_page) | 2285 if (m_page) |
2262 m_page->setIsCursorVisible(isVisible); | 2286 m_page->setIsCursorVisible(isVisible); |
2263 } | 2287 } |
2264 | 2288 |
2265 void WebViewImpl::mouseCaptureLost() | 2289 void WebViewImpl::mouseCaptureLost() |
2266 { | 2290 { |
2267 TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); | 2291 TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); |
2268 m_mouseCaptureNode = nullptr; | 2292 m_mouseCaptureNode = nullptr; |
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4613 void WebViewImpl::detachPaintArtifactCompositor() | 4637 void WebViewImpl::detachPaintArtifactCompositor() |
4614 { | 4638 { |
4615 if (!m_layerTreeView) | 4639 if (!m_layerTreeView) |
4616 return; | 4640 return; |
4617 | 4641 |
4618 m_layerTreeView->setDeferCommits(true); | 4642 m_layerTreeView->setDeferCommits(true); |
4619 m_layerTreeView->clearRootLayer(); | 4643 m_layerTreeView->clearRootLayer(); |
4620 } | 4644 } |
4621 | 4645 |
4622 } // namespace blink | 4646 } // namespace blink |
OLD | NEW |