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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased upto r183571 Created 6 years, 2 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 237
238 void EventHandler::trace(Visitor* visitor) 238 void EventHandler::trace(Visitor* visitor)
239 { 239 {
240 #if ENABLE(OILPAN) 240 #if ENABLE(OILPAN)
241 visitor->trace(m_mousePressNode); 241 visitor->trace(m_mousePressNode);
242 visitor->trace(m_capturingMouseEventsNode); 242 visitor->trace(m_capturingMouseEventsNode);
243 visitor->trace(m_nodeUnderMouse); 243 visitor->trace(m_nodeUnderMouse);
244 visitor->trace(m_lastNodeUnderMouse); 244 visitor->trace(m_lastNodeUnderMouse);
245 visitor->trace(m_lastMouseMoveEventSubframe); 245 visitor->trace(m_lastMouseMoveEventSubframe);
246 visitor->trace(m_lastScrollbarUnderMouse);
246 visitor->trace(m_clickNode); 247 visitor->trace(m_clickNode);
247 visitor->trace(m_dragTarget); 248 visitor->trace(m_dragTarget);
248 visitor->trace(m_frameSetBeingResized); 249 visitor->trace(m_frameSetBeingResized);
249 visitor->trace(m_latchedWheelEventNode); 250 visitor->trace(m_latchedWheelEventNode);
250 visitor->trace(m_previousWheelScrolledNode); 251 visitor->trace(m_previousWheelScrolledNode);
252 visitor->trace(m_scrollbarHandlingScrollGesture);
251 visitor->trace(m_targetForTouchID); 253 visitor->trace(m_targetForTouchID);
252 visitor->trace(m_touchSequenceDocument); 254 visitor->trace(m_touchSequenceDocument);
253 visitor->trace(m_scrollGestureHandlingNode); 255 visitor->trace(m_scrollGestureHandlingNode);
254 visitor->trace(m_previousGestureScrolledNode); 256 visitor->trace(m_previousGestureScrolledNode);
255 visitor->trace(m_lastDeferredTapElement); 257 visitor->trace(m_lastDeferredTapElement);
256 #endif 258 #endif
257 } 259 }
258 260
259 DragState& EventHandler::dragState() 261 DragState& EventHandler::dragState()
260 { 262 {
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 FrameView* view = frame->view(); 1195 FrameView* view = frame->view();
1194 // FIXME: Is it really OK to use the wrong coordinates here when view is 0? 1196 // FIXME: Is it really OK to use the wrong coordinates here when view is 0?
1195 // Historically the code would just crash; this is clearly no worse than tha t. 1197 // Historically the code would just crash; this is clearly no worse than tha t.
1196 return view ? view->windowToContents(windowPoint) : windowPoint; 1198 return view ? view->windowToContents(windowPoint) : windowPoint;
1197 } 1199 }
1198 1200
1199 bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) 1201 bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
1200 { 1202 {
1201 TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent"); 1203 TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent");
1202 1204
1203 RefPtr<FrameView> protector(m_frame->view()); 1205 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
1204 1206
1205 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 1207 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
1206 m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToken = gestureIndicator.currentToken(); 1208 m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToken = gestureIndicator.currentToken();
1207 1209
1208 cancelFakeMouseMoveEvent(); 1210 cancelFakeMouseMoveEvent();
1209 if (m_eventHandlerWillResetCapturingMouseEventsNode) 1211 if (m_eventHandlerWillResetCapturingMouseEventsNode)
1210 m_capturingMouseEventsNode = nullptr; 1212 m_capturingMouseEventsNode = nullptr;
1211 m_mousePressed = true; 1213 m_mousePressed = true;
1212 m_capturesDragging = true; 1214 m_capturesDragging = true;
1213 setLastKnownMousePosition(mouseEvent); 1215 setLastKnownMousePosition(mouseEvent);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 return scrollableArea; 1339 return scrollableArea;
1338 } 1340 }
1339 1341
1340 return 0; 1342 return 0;
1341 } 1343 }
1342 1344
1343 bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& event) 1345 bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& event)
1344 { 1346 {
1345 TRACE_EVENT0("blink", "EventHandler::handleMouseMoveEvent"); 1347 TRACE_EVENT0("blink", "EventHandler::handleMouseMoveEvent");
1346 1348
1347 RefPtr<FrameView> protector(m_frame->view()); 1349 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
1348 MaximumDurationTracker maxDurationTracker(&m_maxMouseMovedDuration); 1350 MaximumDurationTracker maxDurationTracker(&m_maxMouseMovedDuration);
1349 1351
1350 HitTestResult hoveredNode = HitTestResult(LayoutPoint()); 1352 HitTestResult hoveredNode = HitTestResult(LayoutPoint());
1351 bool result = handleMouseMoveOrLeaveEvent(event, &hoveredNode); 1353 bool result = handleMouseMoveOrLeaveEvent(event, &hoveredNode);
1352 1354
1353 Page* page = m_frame->page(); 1355 Page* page = m_frame->page();
1354 if (!page) 1356 if (!page)
1355 return result; 1357 return result;
1356 1358
1357 if (RenderLayer* layer = layerForNode(hoveredNode.innerNode())) { 1359 if (RenderLayer* layer = layerForNode(hoveredNode.innerNode())) {
1358 if (ScrollableArea* layerScrollableArea = associatedScrollableArea(layer )) 1360 if (ScrollableArea* layerScrollableArea = associatedScrollableArea(layer ))
1359 layerScrollableArea->mouseMovedInContentArea(); 1361 layerScrollableArea->mouseMovedInContentArea();
1360 } 1362 }
1361 1363
1362 if (FrameView* frameView = m_frame->view()) 1364 if (FrameView* frameView = m_frame->view())
1363 frameView->mouseMovedInContentArea(); 1365 frameView->mouseMovedInContentArea();
1364 1366
1365 hoveredNode.setToShadowHostIfInUserAgentShadowRoot(); 1367 hoveredNode.setToShadowHostIfInUserAgentShadowRoot();
1366 page->chrome().mouseDidMoveOverElement(hoveredNode, event.modifierFlags()); 1368 page->chrome().mouseDidMoveOverElement(hoveredNode, event.modifierFlags());
1367 page->chrome().setToolTip(hoveredNode); 1369 page->chrome().setToolTip(hoveredNode);
1368 1370
1369 return result; 1371 return result;
1370 } 1372 }
1371 1373
1372 void EventHandler::handleMouseLeaveEvent(const PlatformMouseEvent& event) 1374 void EventHandler::handleMouseLeaveEvent(const PlatformMouseEvent& event)
1373 { 1375 {
1374 TRACE_EVENT0("blink", "EventHandler::handleMouseLeaveEvent"); 1376 TRACE_EVENT0("blink", "EventHandler::handleMouseLeaveEvent");
1375 1377
1376 RefPtr<FrameView> protector(m_frame->view()); 1378 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
1377 handleMouseMoveOrLeaveEvent(event); 1379 handleMouseMoveOrLeaveEvent(event);
1378 } 1380 }
1379 1381
1380 bool EventHandler::handleMouseMoveOrLeaveEvent(const PlatformMouseEvent& mouseEv ent, HitTestResult* hoveredNode, bool onlyUpdateScrollbars) 1382 bool EventHandler::handleMouseMoveOrLeaveEvent(const PlatformMouseEvent& mouseEv ent, HitTestResult* hoveredNode, bool onlyUpdateScrollbars)
1381 { 1383 {
1382 ASSERT(m_frame); 1384 ASSERT(m_frame);
1383 ASSERT(m_frame->view()); 1385 ASSERT(m_frame->view());
1384 1386
1385 setLastKnownMousePosition(mouseEvent); 1387 setLastKnownMousePosition(mouseEvent);
1386 1388
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 // controls. 1493 // controls.
1492 if (node.isHTMLElement() && toHTMLElement(node).isInteractiveContent()) 1494 if (node.isHTMLElement() && toHTMLElement(node).isInteractiveContent())
1493 return 0; 1495 return 0;
1494 return NodeRenderingTraversal::parent(&node); 1496 return NodeRenderingTraversal::parent(&node);
1495 } 1497 }
1496 1498
1497 bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) 1499 bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
1498 { 1500 {
1499 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent"); 1501 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent");
1500 1502
1501 RefPtr<FrameView> protector(m_frame->view()); 1503 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
1502 1504
1503 m_frame->selection().setCaretBlinkingSuspended(false); 1505 m_frame->selection().setCaretBlinkingSuspended(false);
1504 1506
1505 OwnPtr<UserGestureIndicator> gestureIndicator; 1507 OwnPtr<UserGestureIndicator> gestureIndicator;
1506 1508
1507 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n) 1509 if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToke n)
1508 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release())); 1510 gestureIndicator = adoptPtr(new UserGestureIndicator(m_frame->localFrame Root()->eventHandler().m_lastMouseDownUserGestureToken.release()));
1509 else 1511 else
1510 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture)); 1512 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin gUserGesture));
1511 1513
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 { \ 1953 { \
1952 setFrameWasScrolledByUser(); \ 1954 setFrameWasScrolledByUser(); \
1953 return true; \ 1955 return true; \
1954 } 1956 }
1955 1957
1956 Document* doc = m_frame->document(); 1958 Document* doc = m_frame->document();
1957 1959
1958 if (!doc->renderView()) 1960 if (!doc->renderView())
1959 return false; 1961 return false;
1960 1962
1961 RefPtr<FrameView> protector(m_frame->view()); 1963 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
1962 1964
1963 FrameView* view = m_frame->view(); 1965 FrameView* view = m_frame->view();
1964 if (!view) 1966 if (!view)
1965 return false; 1967 return false;
1966 1968
1967 LayoutPoint vPoint = view->windowToContents(event.position()); 1969 LayoutPoint vPoint = view->windowToContents(event.position());
1968 1970
1969 HitTestRequest request(HitTestRequest::ReadOnly); 1971 HitTestRequest request(HitTestRequest::ReadOnly);
1970 HitTestResult result(vPoint); 1972 HitTestResult result(vPoint);
1971 doc->renderView()->hitTest(request, result); 1973 doc->renderView()->hitTest(request, result);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 2098
2097 // No hit test result, handle in root instance. Perhaps we should just retur n false instead? 2099 // No hit test result, handle in root instance. Perhaps we should just retur n false instead?
2098 return handleGestureEventInFrame(targetedEvent); 2100 return handleGestureEventInFrame(targetedEvent);
2099 } 2101 }
2100 2102
2101 bool EventHandler::handleGestureEventInFrame(const GestureEventWithHitTestResult s& targetedEvent) 2103 bool EventHandler::handleGestureEventInFrame(const GestureEventWithHitTestResult s& targetedEvent)
2102 { 2104 {
2103 ASSERT(!targetedEvent.event().isScrollEvent()); 2105 ASSERT(!targetedEvent.event().isScrollEvent());
2104 2106
2105 RefPtrWillBeRawPtr<Node> eventTarget = targetedEvent.hitTestResult().innerNo de(); 2107 RefPtrWillBeRawPtr<Node> eventTarget = targetedEvent.hitTestResult().innerNo de();
2106 RefPtr<Scrollbar> scrollbar = targetedEvent.hitTestResult().scrollbar(); 2108 RefPtrWillBeRawPtr<Scrollbar> scrollbar = targetedEvent.hitTestResult().scro llbar();
2107 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); 2109 const PlatformGestureEvent& gestureEvent = targetedEvent.event();
2108 2110
2109 if (scrollbar) { 2111 if (scrollbar) {
2110 bool eventSwallowed = scrollbar->gestureEvent(gestureEvent); 2112 bool eventSwallowed = scrollbar->gestureEvent(gestureEvent);
2111 if (gestureEvent.type() == PlatformEvent::GestureTapDown && eventSwallow ed) 2113 if (gestureEvent.type() == PlatformEvent::GestureTapDown && eventSwallow ed)
2112 m_scrollbarHandlingScrollGesture = scrollbar; 2114 m_scrollbarHandlingScrollGesture = scrollbar;
2113 if (eventSwallowed) 2115 if (eventSwallowed)
2114 return true; 2116 return true;
2115 } 2117 }
2116 2118
(...skipping 23 matching lines...) Expand all
2140 } 2142 }
2141 2143
2142 return false; 2144 return false;
2143 } 2145 }
2144 2146
2145 bool EventHandler::handleGestureScrollEvent(const PlatformGestureEvent& gestureE vent) 2147 bool EventHandler::handleGestureScrollEvent(const PlatformGestureEvent& gestureE vent)
2146 { 2148 {
2147 TRACE_EVENT0("input", "EventHandler::handleGestureScrollEvent"); 2149 TRACE_EVENT0("input", "EventHandler::handleGestureScrollEvent");
2148 2150
2149 RefPtrWillBeRawPtr<Node> eventTarget = nullptr; 2151 RefPtrWillBeRawPtr<Node> eventTarget = nullptr;
2150 RefPtr<Scrollbar> scrollbar; 2152 RefPtrWillBeRawPtr<Scrollbar> scrollbar = nullptr;
2151 if (gestureEvent.type() != PlatformEvent::GestureScrollBegin) { 2153 if (gestureEvent.type() != PlatformEvent::GestureScrollBegin) {
2152 scrollbar = m_scrollbarHandlingScrollGesture.get(); 2154 scrollbar = m_scrollbarHandlingScrollGesture.get();
2153 eventTarget = m_scrollGestureHandlingNode.get(); 2155 eventTarget = m_scrollGestureHandlingNode.get();
2154 } 2156 }
2155 2157
2156 if (!eventTarget) { 2158 if (!eventTarget) {
2157 Document* document = m_frame->document(); 2159 Document* document = m_frame->document();
2158 if (!document->renderView()) 2160 if (!document->renderView())
2159 return false; 2161 return false;
2160 2162
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 case PlatformEvent::GesturePinchUpdate: 2209 case PlatformEvent::GesturePinchUpdate:
2208 return false; 2210 return false;
2209 default: 2211 default:
2210 ASSERT_NOT_REACHED(); 2212 ASSERT_NOT_REACHED();
2211 return false; 2213 return false;
2212 } 2214 }
2213 } 2215 }
2214 2216
2215 bool EventHandler::handleGestureTap(const GestureEventWithHitTestResults& target edEvent) 2217 bool EventHandler::handleGestureTap(const GestureEventWithHitTestResults& target edEvent)
2216 { 2218 {
2217 RefPtr<FrameView> protector(m_frame->view()); 2219 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
2218 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); 2220 const PlatformGestureEvent& gestureEvent = targetedEvent.event();
2219 HitTestRequest::HitTestRequestType hitType = getHitTypeForGestureType(gestur eEvent.type()); 2221 HitTestRequest::HitTestRequestType hitType = getHitTypeForGestureType(gestur eEvent.type());
2220 2222
2221 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 2223 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
2222 2224
2223 unsigned modifierFlags = 0; 2225 unsigned modifierFlags = 0;
2224 if (gestureEvent.altKey()) 2226 if (gestureEvent.altKey())
2225 modifierFlags |= PlatformEvent::AltKey; 2227 modifierFlags |= PlatformEvent::AltKey;
2226 if (gestureEvent.ctrlKey()) 2228 if (gestureEvent.ctrlKey())
2227 modifierFlags |= PlatformEvent::CtrlKey; 2229 modifierFlags |= PlatformEvent::CtrlKey;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 m_mouseDown = mouseDownEvent; 2309 m_mouseDown = mouseDownEvent;
2308 2310
2309 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, 2311 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1,
2310 gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey (), gestureEvent.metaKey(), PlatformMouseEvent::FromTouch, WTF::currentTime()); 2312 gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey (), gestureEvent.metaKey(), PlatformMouseEvent::FromTouch, WTF::currentTime());
2311 HitTestRequest request(HitTestRequest::ReadOnly); 2313 HitTestRequest request(HitTestRequest::ReadOnly);
2312 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent); 2314 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent);
2313 m_didStartDrag = false; 2315 m_didStartDrag = false;
2314 m_mouseDownMayStartDrag = true; 2316 m_mouseDownMayStartDrag = true;
2315 dragState().m_dragSrc = nullptr; 2317 dragState().m_dragSrc = nullptr;
2316 m_mouseDownPos = m_frame->view()->windowToContents(mouseDragEvent.positi on()); 2318 m_mouseDownPos = m_frame->view()->windowToContents(mouseDragEvent.positi on());
2317 RefPtr<FrameView> protector(m_frame->view()); 2319 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
2318 handleDrag(mev, DontCheckDragHysteresis); 2320 handleDrag(mev, DontCheckDragHysteresis);
2319 if (m_didStartDrag) { 2321 if (m_didStartDrag) {
2320 m_longTapShouldInvokeContextMenu = true; 2322 m_longTapShouldInvokeContextMenu = true;
2321 return true; 2323 return true;
2322 } 2324 }
2323 } 2325 }
2324 #if OS(ANDROID) 2326 #if OS(ANDROID)
2325 bool shouldLongPressSelectWord = true; 2327 bool shouldLongPressSelectWord = true;
2326 #else 2328 #else
2327 bool shouldLongPressSelectWord = m_frame->settings() && m_frame->settings()- >touchEditingEnabled(); 2329 bool shouldLongPressSelectWord = m_frame->settings() && m_frame->settings()- >touchEditingEnabled();
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 2440
2439 Node* node = m_scrollGestureHandlingNode.get(); 2441 Node* node = m_scrollGestureHandlingNode.get();
2440 if (!node) 2442 if (!node)
2441 return sendScrollEventToView(gestureEvent, delta); 2443 return sendScrollEventToView(gestureEvent, delta);
2442 2444
2443 // Ignore this event if the targeted node does not have a valid renderer. 2445 // Ignore this event if the targeted node does not have a valid renderer.
2444 RenderObject* renderer = node->renderer(); 2446 RenderObject* renderer = node->renderer();
2445 if (!renderer) 2447 if (!renderer)
2446 return false; 2448 return false;
2447 2449
2448 RefPtr<FrameView> protector(m_frame->view()); 2450 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
2449 2451
2450 Node* stopNode = 0; 2452 Node* stopNode = 0;
2451 bool scrollShouldNotPropagate = gestureEvent.type() == PlatformEvent::Gestur eScrollUpdateWithoutPropagation; 2453 bool scrollShouldNotPropagate = gestureEvent.type() == PlatformEvent::Gestur eScrollUpdateWithoutPropagation;
2452 2454
2453 // Try to send the event to the correct view. 2455 // Try to send the event to the correct view.
2454 if (passScrollGestureEventToWidget(gestureEvent, renderer)) { 2456 if (passScrollGestureEventToWidget(gestureEvent, renderer)) {
2455 if(scrollShouldNotPropagate) 2457 if(scrollShouldNotPropagate)
2456 m_previousGestureScrolledNode = m_scrollGestureHandlingNode; 2458 m_previousGestureScrolledNode = m_scrollGestureHandlingNode;
2457 2459
2458 return true; 2460 return true;
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 2996
2995 int keyCode = keyEvent.windowsVirtualKeyCode(); 2997 int keyCode = keyEvent.windowsVirtualKeyCode();
2996 return (keyCode >= VK_BACK && keyCode <= VK_CAPITAL) 2998 return (keyCode >= VK_BACK && keyCode <= VK_CAPITAL)
2997 || (keyCode >= VK_SPACE && keyCode <= VK_DELETE) 2999 || (keyCode >= VK_SPACE && keyCode <= VK_DELETE)
2998 || (keyCode >= VK_OEM_1 && keyCode <= VK_OEM_PLUS) 3000 || (keyCode >= VK_OEM_1 && keyCode <= VK_OEM_PLUS)
2999 || (keyCode >= VK_MULTIPLY && keyCode <= VK_OEM_8); 3001 || (keyCode >= VK_MULTIPLY && keyCode <= VK_OEM_8);
3000 } 3002 }
3001 3003
3002 bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent) 3004 bool EventHandler::keyEvent(const PlatformKeyboardEvent& initialKeyEvent)
3003 { 3005 {
3004 RefPtr<FrameView> protector(m_frame->view()); 3006 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view());
3005 3007
3006 ASSERT(m_frame->document()); 3008 ASSERT(m_frame->document());
3007 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*m_frame->document())) { 3009 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*m_frame->document())) {
3008 if (fullscreen->webkitCurrentFullScreenElement() && !isKeyEventAllowedIn FullScreen(fullscreen, initialKeyEvent)) { 3010 if (fullscreen->webkitCurrentFullScreenElement() && !isKeyEventAllowedIn FullScreen(fullscreen, initialKeyEvent)) {
3009 UseCounter::count(*m_frame->document(), UseCounter::KeyEventNotAllow edInFullScreen); 3011 UseCounter::count(*m_frame->document(), UseCounter::KeyEventNotAllow edInFullScreen);
3010 return false; 3012 return false;
3011 } 3013 }
3012 } 3014 }
3013 3015
3014 if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL) 3016 if (initialKeyEvent.windowsVirtualKeyCode() == VK_CAPITAL)
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
3886 unsigned EventHandler::accessKeyModifiers() 3888 unsigned EventHandler::accessKeyModifiers()
3887 { 3889 {
3888 #if OS(MACOSX) 3890 #if OS(MACOSX)
3889 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3891 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3890 #else 3892 #else
3891 return PlatformEvent::AltKey; 3893 return PlatformEvent::AltKey;
3892 #endif 3894 #endif
3893 } 3895 }
3894 3896
3895 } // namespace blink 3897 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698