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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 /* 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
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>
66 64
67 namespace blink { 65 namespace blink {
68 66
69 // WebFrameWidget -------------------------------------------------------------- -- 67 // WebFrameWidget -------------------------------------------------------------- --
70 68
71 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, WebLocalFrame* l ocalRoot) 69 WebFrameWidget* WebFrameWidget::create(WebWidgetClient* client, WebLocalFrame* l ocalRoot)
72 { 70 {
73 // Pass the WebFrameWidget's self-reference to the caller. 71 // Pass the WebFrameWidget's self-reference to the caller.
74 return WebFrameWidgetImpl::create(client, localRoot); 72 return WebFrameWidgetImpl::create(client, localRoot);
75 } 73 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 337
340 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type)) { 338 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type)) {
341 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type); 339 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type);
342 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. 340 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it.
343 Node* node = m_mouseCaptureNode; 341 Node* node = m_mouseCaptureNode;
344 342
345 // Not all platforms call mouseCaptureLost() directly. 343 // Not all platforms call mouseCaptureLost() directly.
346 if (inputEvent.type == WebInputEvent::MouseUp) 344 if (inputEvent.type == WebInputEvent::MouseUp)
347 mouseCaptureLost(); 345 mouseCaptureLost();
348 346
349 std::unique_ptr<UserGestureIndicator> gestureIndicator; 347 OwnPtr<UserGestureIndicator> gestureIndicator;
350 348
351 AtomicString eventType; 349 AtomicString eventType;
352 switch (inputEvent.type) { 350 switch (inputEvent.type) {
353 case WebInputEvent::MouseMove: 351 case WebInputEvent::MouseMove:
354 eventType = EventTypeNames::mousemove; 352 eventType = EventTypeNames::mousemove;
355 break; 353 break;
356 case WebInputEvent::MouseLeave: 354 case WebInputEvent::MouseLeave:
357 eventType = EventTypeNames::mouseout; 355 eventType = EventTypeNames::mouseout;
358 break; 356 break;
359 case WebInputEvent::MouseDown: 357 case WebInputEvent::MouseDown:
360 eventType = EventTypeNames::mousedown; 358 eventType = EventTypeNames::mousedown;
361 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyPro cessingNewUserGesture)); 359 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProce ssingNewUserGesture));
362 m_mouseCaptureGestureToken = gestureIndicator->currentToken(); 360 m_mouseCaptureGestureToken = gestureIndicator->currentToken();
363 break; 361 break;
364 case WebInputEvent::MouseUp: 362 case WebInputEvent::MouseUp:
365 eventType = EventTypeNames::mouseup; 363 eventType = EventTypeNames::mouseup;
366 gestureIndicator = wrapUnique(new UserGestureIndicator(m_mouseCaptur eGestureToken.release())); 364 gestureIndicator = adoptPtr(new UserGestureIndicator(m_mouseCaptureG estureToken.release()));
367 break; 365 break;
368 default: 366 default:
369 NOTREACHED(); 367 NOTREACHED();
370 } 368 }
371 369
372 node->dispatchMouseEvent( 370 node->dispatchMouseEvent(
373 PlatformMouseEventBuilder(m_localRoot->frameView(), static_cast<cons t WebMouseEvent&>(inputEvent)), 371 PlatformMouseEventBuilder(m_localRoot->frameView(), static_cast<cons t WebMouseEvent&>(inputEvent)),
374 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount) ; 372 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount) ;
375 return WebInputEventResult::HandledSystem; 373 return WebInputEventResult::HandledSystem;
376 } 374 }
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 1127
1130 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p osInRootFrame) 1128 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p osInRootFrame)
1131 { 1129 {
1132 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo tFrame)); 1130 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo tFrame));
1133 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); 1131 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
1134 result.setToShadowHostIfInUserAgentShadowRoot(); 1132 result.setToShadowHostIfInUserAgentShadowRoot();
1135 return result; 1133 return result;
1136 } 1134 }
1137 1135
1138 } // namespace blink 1136 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebHelperPluginImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698