| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/presentation/PresentationAvailability.h" | 5 #include "modules/presentation/PresentationAvailability.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/events/Event.h" | 9 #include "core/events/Event.h" |
| 10 #include "core/frame/UseCounter.h" | 10 #include "core/frame/UseCounter.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const AtomicString& PresentationAvailability::interfaceName() const | 57 const AtomicString& PresentationAvailability::interfaceName() const |
| 58 { | 58 { |
| 59 return EventTargetNames::PresentationAvailability; | 59 return EventTargetNames::PresentationAvailability; |
| 60 } | 60 } |
| 61 | 61 |
| 62 ExecutionContext* PresentationAvailability::getExecutionContext() const | 62 ExecutionContext* PresentationAvailability::getExecutionContext() const |
| 63 { | 63 { |
| 64 return ActiveDOMObject::getExecutionContext(); | 64 return ActiveDOMObject::getExecutionContext(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool PresentationAvailability::addEventListenerInternal(const AtomicString& even
tType, EventListener* listener, const EventListenerOptions& options) | 67 void PresentationAvailability::addedEventListener(const AtomicString& eventType,
RegisteredEventListener& registeredListener) |
| 68 { | 68 { |
| 69 EventTargetWithInlineData::addedEventListener(eventType, registeredListener)
; |
| 69 if (eventType == EventTypeNames::change) | 70 if (eventType == EventTypeNames::change) |
| 70 UseCounter::count(getExecutionContext(), UseCounter::PresentationAvailab
ilityChangeEventListener); | 71 UseCounter::count(getExecutionContext(), UseCounter::PresentationAvailab
ilityChangeEventListener); |
| 71 | |
| 72 return EventTarget::addEventListenerInternal(eventType, listener, options); | |
| 73 } | 72 } |
| 74 | 73 |
| 75 void PresentationAvailability::availabilityChanged(bool value) | 74 void PresentationAvailability::availabilityChanged(bool value) |
| 76 { | 75 { |
| 77 if (m_value == value) | 76 if (m_value == value) |
| 78 return; | 77 return; |
| 79 | 78 |
| 80 m_value = value; | 79 m_value = value; |
| 81 dispatchEvent(Event::create(EventTypeNames::change)); | 80 dispatchEvent(Event::create(EventTypeNames::change)); |
| 82 } | 81 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 136 } |
| 138 | 137 |
| 139 DEFINE_TRACE(PresentationAvailability) | 138 DEFINE_TRACE(PresentationAvailability) |
| 140 { | 139 { |
| 141 EventTargetWithInlineData::trace(visitor); | 140 EventTargetWithInlineData::trace(visitor); |
| 142 PageLifecycleObserver::trace(visitor); | 141 PageLifecycleObserver::trace(visitor); |
| 143 ActiveDOMObject::trace(visitor); | 142 ActiveDOMObject::trace(visitor); |
| 144 } | 143 } |
| 145 | 144 |
| 146 } // namespace blink | 145 } // namespace blink |
| OLD | NEW |