| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 void PresentationAvailability::resume() { | 89 void PresentationAvailability::resume() { |
| 90 setState(State::Active); | 90 setState(State::Active); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void PresentationAvailability::suspend() { | 93 void PresentationAvailability::suspend() { |
| 94 setState(State::Suspended); | 94 setState(State::Suspended); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void PresentationAvailability::contextDestroyed() { | 97 void PresentationAvailability::contextDestroyed(ExecutionContext*) { |
| 98 setState(State::Inactive); | 98 setState(State::Inactive); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void PresentationAvailability::contextDestroyed(Page*) {} |
| 102 |
| 101 void PresentationAvailability::pageVisibilityChanged() { | 103 void PresentationAvailability::pageVisibilityChanged() { |
| 102 if (m_state == State::Inactive) | 104 if (m_state == State::Inactive) |
| 103 return; | 105 return; |
| 104 updateListening(); | 106 updateListening(); |
| 105 } | 107 } |
| 106 | 108 |
| 107 void PresentationAvailability::setState(State state) { | 109 void PresentationAvailability::setState(State state) { |
| 108 m_state = state; | 110 m_state = state; |
| 109 updateListening(); | 111 updateListening(); |
| 110 } | 112 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 130 return m_value; | 132 return m_value; |
| 131 } | 133 } |
| 132 | 134 |
| 133 DEFINE_TRACE(PresentationAvailability) { | 135 DEFINE_TRACE(PresentationAvailability) { |
| 134 EventTargetWithInlineData::trace(visitor); | 136 EventTargetWithInlineData::trace(visitor); |
| 135 PageVisibilityObserver::trace(visitor); | 137 PageVisibilityObserver::trace(visitor); |
| 136 SuspendableObject::trace(visitor); | 138 SuspendableObject::trace(visitor); |
| 137 } | 139 } |
| 138 | 140 |
| 139 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |