OLD | NEW |
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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1435 |
1436 void LocalDOMWindow::AddedEventListener( | 1436 void LocalDOMWindow::AddedEventListener( |
1437 const AtomicString& event_type, | 1437 const AtomicString& event_type, |
1438 RegisteredEventListener& registered_listener) { | 1438 RegisteredEventListener& registered_listener) { |
1439 DOMWindow::AddedEventListener(event_type, registered_listener); | 1439 DOMWindow::AddedEventListener(event_type, registered_listener); |
1440 if (GetFrame() && GetFrame()->GetPage()) | 1440 if (GetFrame() && GetFrame()->GetPage()) |
1441 GetFrame()->GetPage()->GetEventHandlerRegistry().DidAddEventHandler( | 1441 GetFrame()->GetPage()->GetEventHandlerRegistry().DidAddEventHandler( |
1442 *this, event_type, registered_listener.Options()); | 1442 *this, event_type, registered_listener.Options()); |
1443 | 1443 |
1444 if (Document* document = this->document()) | 1444 if (Document* document = this->document()) |
1445 document->AddListenerTypeIfNeeded(event_type); | 1445 document->AddListenerTypeIfNeeded(event_type, *this); |
1446 | 1446 |
1447 for (auto& it : event_listener_observers_) { | 1447 for (auto& it : event_listener_observers_) { |
1448 it->DidAddEventListener(this, event_type); | 1448 it->DidAddEventListener(this, event_type); |
1449 } | 1449 } |
1450 | 1450 |
1451 if (event_type == EventTypeNames::unload) { | 1451 if (event_type == EventTypeNames::unload) { |
1452 UseCounter::Count(document(), UseCounter::kDocumentUnloadRegistered); | 1452 UseCounter::Count(document(), UseCounter::kDocumentUnloadRegistered); |
1453 AddUnloadEventListener(this); | 1453 AddUnloadEventListener(this); |
1454 } else if (event_type == EventTypeNames::beforeunload) { | 1454 } else if (event_type == EventTypeNames::beforeunload) { |
1455 UseCounter::Count(document(), UseCounter::kDocumentBeforeUnloadRegistered); | 1455 UseCounter::Count(document(), UseCounter::kDocumentBeforeUnloadRegistered); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 DOMWindow::Trace(visitor); | 1684 DOMWindow::Trace(visitor); |
1685 Supplementable<LocalDOMWindow>::Trace(visitor); | 1685 Supplementable<LocalDOMWindow>::Trace(visitor); |
1686 } | 1686 } |
1687 | 1687 |
1688 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1688 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
1689 visitor->TraceWrappers(custom_elements_); | 1689 visitor->TraceWrappers(custom_elements_); |
1690 DOMWindow::TraceWrappers(visitor); | 1690 DOMWindow::TraceWrappers(visitor); |
1691 } | 1691 } |
1692 | 1692 |
1693 } // namespace blink | 1693 } // namespace blink |
OLD | NEW |