| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef PresentationAvailability_h | 5 #ifndef PresentationAvailability_h |
| 6 #define PresentationAvailability_h | 6 #define PresentationAvailability_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "core/dom/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 11 #include "core/page/PageLifecycleObserver.h" | 11 #include "core/page/PageLifecycleObserver.h" |
| 12 #include "modules/ModulesExport.h" | 12 #include "modules/ModulesExport.h" |
| 13 #include "platform/weborigin/KURL.h" | 13 #include "platform/weborigin/KURL.h" |
| 14 #include "public/platform/WebURL.h" | 14 #include "public/platform/WebURL.h" |
| 15 #include "public/platform/modules/presentation/WebPresentationAvailabilityObserv
er.h" | 15 #include "public/platform/modules/presentation/WebPresentationAvailabilityObserv
er.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class ExecutionContext; | 19 class ExecutionContext; |
| 20 class ScriptPromiseResolver; | 20 class ScriptPromiseResolver; |
| 21 | 21 |
| 22 // Expose whether there is a presentation display available for |url|. The | 22 // Expose whether there is a presentation display available for |url|. The |
| 23 // object will be initialized with a default value passed via ::take() and will | 23 // object will be initialized with a default value passed via ::take() and will |
| 24 // then subscribe to receive callbacks if the status for |url| were to | 24 // then subscribe to receive callbacks if the status for |url| were to |
| 25 // change. The object will only listen to changes when required. | 25 // change. The object will only listen to changes when required. |
| 26 class MODULES_EXPORT PresentationAvailability final | 26 class MODULES_EXPORT PresentationAvailability final |
| 27 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAva
ilability> | 27 : public EventTargetWithInlineData |
| 28 , public ActiveScriptWrappable | 28 , public ActiveScriptWrappable |
| 29 , public ActiveDOMObject | 29 , public ActiveDOMObject |
| 30 , public PageLifecycleObserver | 30 , public PageLifecycleObserver |
| 31 , public WebPresentationAvailabilityObserver { | 31 , public WebPresentationAvailabilityObserver { |
| 32 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability); | 32 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability); |
| 33 USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); | 33 USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); |
| 34 DEFINE_WRAPPERTYPEINFO(); | 34 DEFINE_WRAPPERTYPEINFO(); |
| 35 public: | 35 public: |
| 36 static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, b
ool); | 36 static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, b
ool); |
| 37 ~PresentationAvailability() override; | 37 ~PresentationAvailability() override; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void updateListening(); | 82 void updateListening(); |
| 83 | 83 |
| 84 const KURL m_url; | 84 const KURL m_url; |
| 85 bool m_value; | 85 bool m_value; |
| 86 State m_state; | 86 State m_state; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace blink | 89 } // namespace blink |
| 90 | 90 |
| 91 #endif // PresentationAvailability_h | 91 #endif // PresentationAvailability_h |
| OLD | NEW |