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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge. 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 #include "platform/RuntimeEnabledFeatures.h" 93 #include "platform/RuntimeEnabledFeatures.h"
94 #include "platform/TraceEvent.h" 94 #include "platform/TraceEvent.h"
95 #include "platform/WindowsKeyboardCodes.h" 95 #include "platform/WindowsKeyboardCodes.h"
96 #include "platform/geometry/FloatPoint.h" 96 #include "platform/geometry/FloatPoint.h"
97 #include "platform/graphics/Image.h" 97 #include "platform/graphics/Image.h"
98 #include "platform/heap/Handle.h" 98 #include "platform/heap/Handle.h"
99 #include "platform/scroll/ScrollAnimatorBase.h" 99 #include "platform/scroll/ScrollAnimatorBase.h"
100 #include "platform/scroll/Scrollbar.h" 100 #include "platform/scroll/Scrollbar.h"
101 #include "wtf/Assertions.h" 101 #include "wtf/Assertions.h"
102 #include "wtf/CurrentTime.h" 102 #include "wtf/CurrentTime.h"
103 #include "wtf/PtrUtil.h"
103 #include "wtf/StdLibExtras.h" 104 #include "wtf/StdLibExtras.h"
104 #include "wtf/TemporaryChange.h" 105 #include "wtf/TemporaryChange.h"
106 #include <memory>
105 107
106 namespace blink { 108 namespace blink {
107 109
108 namespace { 110 namespace {
109 111
110 // Refetch the event target node if it is removed or currently is the shadow nod e inside an <input> element. 112 // Refetch the event target node if it is removed or currently is the shadow nod e inside an <input> element.
111 // If a mouse event handler changes the input element type to one that has a wid get associated, 113 // If a mouse event handler changes the input element type to one that has a wid get associated,
112 // we'd like to EventHandler::handleMousePressEvent to pass the event to the wid get and thus the 114 // we'd like to EventHandler::handleMousePressEvent to pass the event to the wid get and thus the
113 // event target node can't still be the shadow node. 115 // event target node can't still be the shadow node.
114 bool shouldRefetchEventTarget(const MouseEventWithHitTestResults& mev) 116 bool shouldRefetchEventTarget(const MouseEventWithHitTestResults& mev)
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 1107
1106 // For 4th/5th button in the mouse since Chrome does not yet send 1108 // For 4th/5th button in the mouse since Chrome does not yet send
1107 // button value to Blink but in some cases it does send the event. 1109 // button value to Blink but in some cases it does send the event.
1108 // This check is needed to suppress such an event (crbug.com/574959) 1110 // This check is needed to suppress such an event (crbug.com/574959)
1109 if (mouseEvent.button() == NoButton) 1111 if (mouseEvent.button() == NoButton)
1110 return WebInputEventResult::HandledSuppressed; 1112 return WebInputEventResult::HandledSuppressed;
1111 1113
1112 if (!mouseEvent.fromTouch()) 1114 if (!mouseEvent.fromTouch())
1113 m_frame->selection().setCaretBlinkingSuspended(false); 1115 m_frame->selection().setCaretBlinkingSuspended(false);
1114 1116
1115 OwnPtr<UserGestureIndicator> gestureIndicator; 1117 std::unique_ptr<UserGestureIndicator> gestureIndicator;
1116 1118
1117 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n) 1119 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n)
1118 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release())); 1120 gestureIndicator = wrapUnique(new UserGestureIndicator(m_frame->localFra meRoot()->eventHandler().m_lastMouseDownUserGestureToken.release()));
1119 else 1121 else
1120 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture)); 1122 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcess ingUserGesture));
1121 1123
1122 #if OS(WIN) 1124 #if OS(WIN)
1123 if (Page* page = m_frame->page()) 1125 if (Page* page = m_frame->page())
1124 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent); 1126 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent);
1125 #endif 1127 #endif
1126 1128
1127 m_mousePressed = false; 1129 m_mousePressed = false;
1128 setLastKnownMousePosition(mouseEvent); 1130 setLastKnownMousePosition(mouseEvent);
1129 1131
1130 if (m_svgPan) { 1132 if (m_svgPan) {
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2825 2827
2826 FrameHost* EventHandler::frameHost() const 2828 FrameHost* EventHandler::frameHost() const
2827 { 2829 {
2828 if (!m_frame->page()) 2830 if (!m_frame->page())
2829 return nullptr; 2831 return nullptr;
2830 2832
2831 return &m_frame->page()->frameHost(); 2833 return &m_frame->page()->frameHost();
2832 } 2834 }
2833 2835
2834 } // namespace blink 2836 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698