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

Side by Side Diff: Source/modules/presentation/Presentation.h

Issue 940503002: [PresentationAPI] Added plumbing for start/joinSession from JS to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comment Created 5 years, 10 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
OLDNEW
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 #ifndef Presentation_h 5 #ifndef Presentation_h
6 #define Presentation_h 6 #define Presentation_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "core/events/EventTarget.h" 9 #include "core/events/EventTarget.h"
10 #include "core/frame/DOMWindowProperty.h" 10 #include "core/frame/DOMWindowProperty.h"
11 #include "modules/presentation/PresentationSession.h" 11 #include "modules/presentation/PresentationSession.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "platform/heap/Heap.h"
13 14
14 namespace WTF { 15 namespace WTF {
15 class String; 16 class String;
16 } // namespace WTF 17 } // namespace WTF
17 18
18 namespace blink { 19 namespace blink {
19 20
20 class LocalFrame; 21 class LocalFrame;
21 class PresentationController; 22 class PresentationController;
22 class ScriptState; 23 class ScriptState;
(...skipping 26 matching lines...) Expand all
49 // The embedder needs to keep track if anything is listening to the event so it could stop the 50 // The embedder needs to keep track if anything is listening to the event so it could stop the
50 // might be expensive screen discovery process. 51 // might be expensive screen discovery process.
51 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture) override; 52 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture) override;
52 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E ventListener>, bool useCapture) override; 53 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E ventListener>, bool useCapture) override;
53 virtual void removeAllEventListeners() override; 54 virtual void removeAllEventListeners() override;
54 55
55 // Called when the |availablechange| event needs to be fired. 56 // Called when the |availablechange| event needs to be fired.
56 void didChangeAvailability(bool available); 57 void didChangeAvailability(bool available);
57 // Queried by the controller if |availablechange| event has any listeners. 58 // Queried by the controller if |availablechange| event has any listeners.
58 bool isAvailableChangeWatched() const; 59 bool isAvailableChangeWatched() const;
60 // Adds a session to the open sessions list.
61 void didCreateSession(PresentationSession*);
62
59 private: 63 private:
60 explicit Presentation(LocalFrame*); 64 explicit Presentation(LocalFrame*);
61 65
62 // Returns the |PresentationController| object associated with the frame |Pr esentation| corresponds to. 66 // Returns the |PresentationController| object associated with the frame |Pr esentation| corresponds to.
63 // Can return |nullptr| if the frame is detached from the document. 67 // Can return |nullptr| if the frame is detached from the document.
64 PresentationController* presentationController(); 68 PresentationController* presentationController();
65 69
70 // The session object provided to the presentation page. Not supported.
66 Member<PresentationSession> m_session; 71 Member<PresentationSession> m_session;
72
73 // The sessions opened for this frame.
74 HeapHashSet<Member<PresentationSession>> m_openSessions;
67 }; 75 };
68 76
69 } // namespace blink 77 } // namespace blink
70 78
71 #endif // Presentation_h 79 #endif // Presentation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698