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 24 matching lines...) Expand all Loading... |
35 #include "core/InputTypeNames.h" | 35 #include "core/InputTypeNames.h" |
36 #include "core/clipboard/DataObject.h" | 36 #include "core/clipboard/DataObject.h" |
37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
38 #include "core/dom/Fullscreen.h" | 38 #include "core/dom/Fullscreen.h" |
39 #include "core/dom/LayoutTreeBuilderTraversal.h" | 39 #include "core/dom/LayoutTreeBuilderTraversal.h" |
40 #include "core/dom/Text.h" | 40 #include "core/dom/Text.h" |
41 #include "core/editing/EditingUtilities.h" | 41 #include "core/editing/EditingUtilities.h" |
42 #include "core/editing/Editor.h" | 42 #include "core/editing/Editor.h" |
43 #include "core/editing/FrameSelection.h" | 43 #include "core/editing/FrameSelection.h" |
44 #include "core/editing/InputMethodController.h" | 44 #include "core/editing/InputMethodController.h" |
| 45 #include "core/editing/SelectionController.h" |
45 #include "core/editing/iterators/TextIterator.h" | 46 #include "core/editing/iterators/TextIterator.h" |
46 #include "core/editing/markers/DocumentMarkerController.h" | 47 #include "core/editing/markers/DocumentMarkerController.h" |
47 #include "core/editing/serializers/HTMLInterchange.h" | 48 #include "core/editing/serializers/HTMLInterchange.h" |
48 #include "core/editing/serializers/Serialization.h" | 49 #include "core/editing/serializers/Serialization.h" |
49 #include "core/events/KeyboardEvent.h" | 50 #include "core/events/KeyboardEvent.h" |
50 #include "core/events/UIEventWithKeyState.h" | 51 #include "core/events/UIEventWithKeyState.h" |
51 #include "core/events/WheelEvent.h" | 52 #include "core/events/WheelEvent.h" |
52 #include "core/fetch/UniqueIdentifier.h" | 53 #include "core/fetch/UniqueIdentifier.h" |
53 #include "core/frame/EventHandlerRegistry.h" | 54 #include "core/frame/EventHandlerRegistry.h" |
54 #include "core/frame/FrameHost.h" | 55 #include "core/frame/FrameHost.h" |
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 if (pinchEvent.data.pinchUpdate.zoomDisabled) | 2250 if (pinchEvent.data.pinchUpdate.zoomDisabled) |
2250 return WebInputEventResult::NotHandled; | 2251 return WebInputEventResult::NotHandled; |
2251 | 2252 |
2252 if (page()->frameHost().visualViewport().magnifyScaleAroundAnchor(pinchE
vent.data.pinchUpdate.scale, FloatPoint(pinchEvent.x, pinchEvent.y))) | 2253 if (page()->frameHost().visualViewport().magnifyScaleAroundAnchor(pinchE
vent.data.pinchUpdate.scale, FloatPoint(pinchEvent.x, pinchEvent.y))) |
2253 return WebInputEventResult::HandledSystem; | 2254 return WebInputEventResult::HandledSystem; |
2254 } | 2255 } |
2255 | 2256 |
2256 return WebInputEventResult::NotHandled; | 2257 return WebInputEventResult::NotHandled; |
2257 } | 2258 } |
2258 | 2259 |
| 2260 bool WebViewImpl::selectWordIfAnyAt(const WebPoint& position) |
| 2261 { |
| 2262 HitTestResult result = hitTestResultForRootFramePos(position); |
| 2263 Frame* targetFrame; |
| 2264 if (result.innerNodeOrImageMapImage()) |
| 2265 targetFrame = result.innerNodeOrImageMapImage()->document().frame(); |
| 2266 else |
| 2267 targetFrame = m_page->focusController().focusedOrMainFrame(); |
| 2268 |
| 2269 if (!targetFrame->isLocalFrame()) |
| 2270 return false; |
| 2271 |
| 2272 LocalFrame* localFrame = toLocalFrame(targetFrame); |
| 2273 return localFrame->eventHandler().selectionController().selectWordAtPosition
IfAny(result); |
| 2274 } |
| 2275 |
2259 void WebViewImpl::setCursorVisibilityState(bool isVisible) | 2276 void WebViewImpl::setCursorVisibilityState(bool isVisible) |
2260 { | 2277 { |
2261 if (m_page) | 2278 if (m_page) |
2262 m_page->setIsCursorVisible(isVisible); | 2279 m_page->setIsCursorVisible(isVisible); |
2263 } | 2280 } |
2264 | 2281 |
2265 void WebViewImpl::mouseCaptureLost() | 2282 void WebViewImpl::mouseCaptureLost() |
2266 { | 2283 { |
2267 TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); | 2284 TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this); |
2268 m_mouseCaptureNode = nullptr; | 2285 m_mouseCaptureNode = nullptr; |
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4626 void WebViewImpl::detachPaintArtifactCompositor() | 4643 void WebViewImpl::detachPaintArtifactCompositor() |
4627 { | 4644 { |
4628 if (!m_layerTreeView) | 4645 if (!m_layerTreeView) |
4629 return; | 4646 return; |
4630 | 4647 |
4631 m_layerTreeView->setDeferCommits(true); | 4648 m_layerTreeView->setDeferCommits(true); |
4632 m_layerTreeView->clearRootLayer(); | 4649 m_layerTreeView->clearRootLayer(); |
4633 } | 4650 } |
4634 | 4651 |
4635 } // namespace blink | 4652 } // namespace blink |
OLD | NEW |