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

Side by Side Diff: trunk/Source/core/frame/LocalDOMWindow.cpp

Issue 391483002: Revert 177812 "Migrate touch events to EventHandlerRegistry" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 if (m_frame->page() && m_frame->view()) { 408 if (m_frame->page() && m_frame->view()) {
409 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator()) { 409 if (ScrollingCoordinator* scrollingCoordinator = m_frame->page()->scroll ingCoordinator()) {
410 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), HorizontalScrollbar); 410 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), HorizontalScrollbar);
411 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar); 411 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_frame- >view(), VerticalScrollbar);
412 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew()); 412 scrollingCoordinator->scrollableAreaScrollLayerDidChange(m_frame->vi ew());
413 } 413 }
414 } 414 }
415 415
416 m_frame->selection().updateSecureKeyboardEntryIfActive(); 416 m_frame->selection().updateSecureKeyboardEntryIfActive();
417
418 if (m_frame->isMainFrame()) {
419 if (m_document->hasTouchEventHandlers())
420 m_frame->host()->chrome().client().needTouchEvents(true);
421 }
417 return m_document; 422 return m_document;
418 } 423 }
419 424
420 EventQueue* LocalDOMWindow::eventQueue() const 425 EventQueue* LocalDOMWindow::eventQueue() const
421 { 426 {
422 return m_eventQueue.get(); 427 return m_eventQueue.get();
423 } 428 }
424 429
425 void LocalDOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event) 430 void LocalDOMWindow::enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event> event)
426 { 431 {
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr< EventListener> listener, bool useCapture) 1534 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr< EventListener> listener, bool useCapture)
1530 { 1535 {
1531 if (!EventTarget::addEventListener(eventType, listener, useCapture)) 1536 if (!EventTarget::addEventListener(eventType, listener, useCapture))
1532 return false; 1537 return false;
1533 1538
1534 if (m_frame && m_frame->host()) 1539 if (m_frame && m_frame->host())
1535 m_frame->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT ype); 1540 m_frame->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT ype);
1536 1541
1537 if (Document* document = this->document()) { 1542 if (Document* document = this->document()) {
1538 document->addListenerTypeIfNeeded(eventType); 1543 document->addListenerTypeIfNeeded(eventType);
1539 if (eventType == EventTypeNames::storage) 1544 if (isTouchEventType(eventType))
1545 document->didAddTouchEventHandler(document);
1546 else if (eventType == EventTypeNames::storage)
1540 didAddStorageEventListener(this); 1547 didAddStorageEventListener(this);
1541 } 1548 }
1542 1549
1543 lifecycleNotifier().notifyAddEventListener(this, eventType); 1550 lifecycleNotifier().notifyAddEventListener(this, eventType);
1544 1551
1545 if (eventType == EventTypeNames::unload) { 1552 if (eventType == EventTypeNames::unload) {
1546 UseCounter::count(document(), UseCounter::DocumentUnloadRegistered); 1553 UseCounter::count(document(), UseCounter::DocumentUnloadRegistered);
1547 addUnloadEventListener(this); 1554 addUnloadEventListener(this);
1548 } else if (eventType == EventTypeNames::beforeunload) { 1555 } else if (eventType == EventTypeNames::beforeunload) {
1549 UseCounter::count(document(), UseCounter::DocumentBeforeUnloadRegistered ); 1556 UseCounter::count(document(), UseCounter::DocumentBeforeUnloadRegistered );
(...skipping 12 matching lines...) Expand all
1562 } 1569 }
1563 1570
1564 bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, EventLis tener* listener, bool useCapture) 1571 bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, EventLis tener* listener, bool useCapture)
1565 { 1572 {
1566 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) 1573 if (!EventTarget::removeEventListener(eventType, listener, useCapture))
1567 return false; 1574 return false;
1568 1575
1569 if (m_frame && m_frame->host()) 1576 if (m_frame && m_frame->host())
1570 m_frame->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eve ntType); 1577 m_frame->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eve ntType);
1571 1578
1579 if (Document* document = this->document()) {
1580 if (isTouchEventType(eventType))
1581 document->didRemoveTouchEventHandler(document);
1582 }
1583
1572 lifecycleNotifier().notifyRemoveEventListener(this, eventType); 1584 lifecycleNotifier().notifyRemoveEventListener(this, eventType);
1573 1585
1574 if (eventType == EventTypeNames::unload) { 1586 if (eventType == EventTypeNames::unload) {
1575 removeUnloadEventListener(this); 1587 removeUnloadEventListener(this);
1576 } else if (eventType == EventTypeNames::beforeunload && allowsBeforeUnloadLi steners(this)) { 1588 } else if (eventType == EventTypeNames::beforeunload && allowsBeforeUnloadLi steners(this)) {
1577 removeBeforeUnloadEventListener(this); 1589 removeBeforeUnloadEventListener(this);
1578 } 1590 }
1579 1591
1580 return true; 1592 return true;
1581 } 1593 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 1642
1631 void LocalDOMWindow::removeAllEventListenersInternal(BroadcastListenerRemoval mo de) 1643 void LocalDOMWindow::removeAllEventListenersInternal(BroadcastListenerRemoval mo de)
1632 { 1644 {
1633 EventTarget::removeAllEventListeners(); 1645 EventTarget::removeAllEventListeners();
1634 1646
1635 lifecycleNotifier().notifyRemoveAllEventListeners(this); 1647 lifecycleNotifier().notifyRemoveAllEventListeners(this);
1636 1648
1637 if (mode == DoBroadcastListenerRemoval) { 1649 if (mode == DoBroadcastListenerRemoval) {
1638 if (m_frame && m_frame->host()) 1650 if (m_frame && m_frame->host())
1639 m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*t his); 1651 m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*t his);
1652
1653 if (Document* document = this->document())
1654 document->didClearTouchEventHandlers(document);
1640 } 1655 }
1641 1656
1642 removeAllUnloadEventListeners(this); 1657 removeAllUnloadEventListeners(this);
1643 removeAllBeforeUnloadEventListeners(this); 1658 removeAllBeforeUnloadEventListeners(this);
1644 } 1659 }
1645 1660
1646 void LocalDOMWindow::removeAllEventListeners() 1661 void LocalDOMWindow::removeAllEventListeners()
1647 { 1662 {
1648 removeAllEventListenersInternal(DoBroadcastListenerRemoval); 1663 removeAllEventListenersInternal(DoBroadcastListenerRemoval);
1649 } 1664 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 visitor->trace(m_localStorage); 1942 visitor->trace(m_localStorage);
1928 visitor->trace(m_applicationCache); 1943 visitor->trace(m_applicationCache);
1929 visitor->trace(m_performance); 1944 visitor->trace(m_performance);
1930 visitor->trace(m_css); 1945 visitor->trace(m_css);
1931 visitor->trace(m_eventQueue); 1946 visitor->trace(m_eventQueue);
1932 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); 1947 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
1933 EventTargetWithInlineData::trace(visitor); 1948 EventTargetWithInlineData::trace(visitor);
1934 } 1949 }
1935 1950
1936 } // namespace WebCore 1951 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/core/frame/EventHandlerRegistry.cpp ('k') | trunk/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698