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

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

Powered by Google App Engine
This is Rietveld 408576698