OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "public/web/WebWidgetClient.h" | 54 #include "public/web/WebWidgetClient.h" |
55 #include "web/CompositorMutatorImpl.h" | 55 #include "web/CompositorMutatorImpl.h" |
56 #include "web/CompositorProxyClientImpl.h" | 56 #include "web/CompositorProxyClientImpl.h" |
57 #include "web/ContextMenuAllowedScope.h" | 57 #include "web/ContextMenuAllowedScope.h" |
58 #include "web/WebDevToolsAgentImpl.h" | 58 #include "web/WebDevToolsAgentImpl.h" |
59 #include "web/WebInputEventConversion.h" | 59 #include "web/WebInputEventConversion.h" |
60 #include "web/WebLocalFrameImpl.h" | 60 #include "web/WebLocalFrameImpl.h" |
61 #include "web/WebPluginContainerImpl.h" | 61 #include "web/WebPluginContainerImpl.h" |
62 #include "web/WebRemoteFrameImpl.h" | 62 #include "web/WebRemoteFrameImpl.h" |
63 #include "web/WebViewFrameWidget.h" | 63 #include "web/WebViewFrameWidget.h" |
| 64 #include "wtf/PtrUtil.h" |
| 65 #include <memory> |
64 | 66 |
65 namespace blink { | 67 namespace blink { |
66 | 68 |
67 // WebFrameWidget --------------------------------------------------------------
-- | 69 // WebFrameWidget --------------------------------------------------------------
-- |
68 | 70 |
69 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, WebLocalFrame* l
ocalRoot) | 71 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, WebLocalFrame* l
ocalRoot) |
70 { | 72 { |
71 // Pass the WebFrameWidget's self-reference to the caller. | 73 // Pass the WebFrameWidget's self-reference to the caller. |
72 return WebFrameWidgetImpl::create(client, localRoot); | 74 return WebFrameWidgetImpl::create(client, localRoot); |
73 } | 75 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 339 |
338 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type))
{ | 340 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type))
{ |
339 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type); | 341 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type); |
340 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. | 342 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. |
341 Node* node = m_mouseCaptureNode; | 343 Node* node = m_mouseCaptureNode; |
342 | 344 |
343 // Not all platforms call mouseCaptureLost() directly. | 345 // Not all platforms call mouseCaptureLost() directly. |
344 if (inputEvent.type == WebInputEvent::MouseUp) | 346 if (inputEvent.type == WebInputEvent::MouseUp) |
345 mouseCaptureLost(); | 347 mouseCaptureLost(); |
346 | 348 |
347 OwnPtr<UserGestureIndicator> gestureIndicator; | 349 std::unique_ptr<UserGestureIndicator> gestureIndicator; |
348 | 350 |
349 AtomicString eventType; | 351 AtomicString eventType; |
350 switch (inputEvent.type) { | 352 switch (inputEvent.type) { |
351 case WebInputEvent::MouseMove: | 353 case WebInputEvent::MouseMove: |
352 eventType = EventTypeNames::mousemove; | 354 eventType = EventTypeNames::mousemove; |
353 break; | 355 break; |
354 case WebInputEvent::MouseLeave: | 356 case WebInputEvent::MouseLeave: |
355 eventType = EventTypeNames::mouseout; | 357 eventType = EventTypeNames::mouseout; |
356 break; | 358 break; |
357 case WebInputEvent::MouseDown: | 359 case WebInputEvent::MouseDown: |
358 eventType = EventTypeNames::mousedown; | 360 eventType = EventTypeNames::mousedown; |
359 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProce
ssingNewUserGesture)); | 361 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyPro
cessingNewUserGesture)); |
360 m_mouseCaptureGestureToken = gestureIndicator->currentToken(); | 362 m_mouseCaptureGestureToken = gestureIndicator->currentToken(); |
361 break; | 363 break; |
362 case WebInputEvent::MouseUp: | 364 case WebInputEvent::MouseUp: |
363 eventType = EventTypeNames::mouseup; | 365 eventType = EventTypeNames::mouseup; |
364 gestureIndicator = adoptPtr(new UserGestureIndicator(m_mouseCaptureG
estureToken.release())); | 366 gestureIndicator = wrapUnique(new UserGestureIndicator(m_mouseCaptur
eGestureToken.release())); |
365 break; | 367 break; |
366 default: | 368 default: |
367 NOTREACHED(); | 369 NOTREACHED(); |
368 } | 370 } |
369 | 371 |
370 node->dispatchMouseEvent( | 372 node->dispatchMouseEvent( |
371 PlatformMouseEventBuilder(m_localRoot->frameView(), static_cast<cons
t WebMouseEvent&>(inputEvent)), | 373 PlatformMouseEventBuilder(m_localRoot->frameView(), static_cast<cons
t WebMouseEvent&>(inputEvent)), |
372 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; | 374 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; |
373 return WebInputEventResult::HandledSystem; | 375 return WebInputEventResult::HandledSystem; |
374 } | 376 } |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 | 1129 |
1128 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p
osInRootFrame) | 1130 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p
osInRootFrame) |
1129 { | 1131 { |
1130 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo
tFrame)); | 1132 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo
tFrame)); |
1131 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP
oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); | 1133 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP
oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); |
1132 result.setToShadowHostIfInUserAgentShadowRoot(); | 1134 result.setToShadowHostIfInUserAgentShadowRoot(); |
1133 return result; | 1135 return result; |
1134 } | 1136 } |
1135 | 1137 |
1136 } // namespace blink | 1138 } // namespace blink |
OLD | NEW |