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 CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public NON_EXPORTED_BASE(blink::WebPresentationClient) { | 26 public NON_EXPORTED_BASE(blink::WebPresentationClient) { |
27 public: | 27 public: |
28 explicit PresentationDispatcher(RenderFrame* render_frame); | 28 explicit PresentationDispatcher(RenderFrame* render_frame); |
29 ~PresentationDispatcher() override; | 29 ~PresentationDispatcher() override; |
30 | 30 |
31 private: | 31 private: |
32 // WebPresentationClient implementation. | 32 // WebPresentationClient implementation. |
33 virtual void setController( | 33 virtual void setController( |
34 blink::WebPresentationController* controller); | 34 blink::WebPresentationController* controller); |
35 virtual void updateAvailableChangeWatched(bool watched); | 35 virtual void updateAvailableChangeWatched(bool watched); |
| 36 virtual void updateDefaultPresentationStartWatched(bool watched); |
36 virtual void startSession( | 37 virtual void startSession( |
37 const blink::WebString& presentationUrl, | 38 const blink::WebString& presentationUrl, |
38 const blink::WebString& presentationId, | 39 const blink::WebString& presentationId, |
39 blink::WebPresentationSessionClientCallbacks* callback); | 40 blink::WebPresentationSessionClientCallbacks* callback); |
40 virtual void joinSession( | 41 virtual void joinSession( |
41 const blink::WebString& presentationUrl, | 42 const blink::WebString& presentationUrl, |
42 const blink::WebString& presentationId, | 43 const blink::WebString& presentationId, |
43 blink::WebPresentationSessionClientCallbacks* callback); | 44 blink::WebPresentationSessionClientCallbacks* callback); |
44 | 45 |
45 void OnScreenAvailabilityChanged(bool available); | 46 void OnScreenAvailabilityChanged(bool available); |
46 void OnSessionCreated( | 47 void OnSessionCreated( |
47 blink::WebPresentationSessionClientCallbacks* callback, | 48 blink::WebPresentationSessionClientCallbacks* callback, |
48 presentation::PresentationSessionInfoPtr session_info, | 49 presentation::PresentationSessionInfoPtr session_info, |
49 presentation::PresentationErrorPtr error); | 50 presentation::PresentationErrorPtr error); |
| 51 void OnDefaultPresentationStarted( |
| 52 presentation::PresentationSessionInfoPtr session_info); |
50 | 53 |
51 void ConnectToPresentationServiceIfNeeded(); | 54 void ConnectToPresentationServiceIfNeeded(); |
52 | 55 |
53 // Used as a weak reference. Can be null since lifetime is bound to the frame. | 56 // Used as a weak reference. Can be null since lifetime is bound to the frame. |
54 blink::WebPresentationController* controller_; | 57 blink::WebPresentationController* controller_; |
55 presentation::PresentationServicePtr presentation_service_; | 58 presentation::PresentationServicePtr presentation_service_; |
56 | 59 |
57 // Wrappers around the PresentationSessionPtr corresponding to each Javascript | 60 // Wrappers around the PresentationSessionPtr corresponding to each Javascript |
58 // PresentationSession object passed back to the frame. | 61 // PresentationSession object passed back to the frame. |
59 // TODO(avayvod): Switch to base::IDMap when the lookup by presentation id is | 62 // TODO(avayvod): Switch to base::IDMap when the lookup by presentation id is |
60 // needed. | 63 // needed. |
61 using PresentationSessionDispatchers = | 64 using PresentationSessionDispatchers = |
62 ScopedVector<PresentationSessionDispatcher>; | 65 ScopedVector<PresentationSessionDispatcher>; |
63 PresentationSessionDispatchers presentation_session_dispatchers_; | 66 PresentationSessionDispatchers presentation_session_dispatchers_; |
64 }; | 67 }; |
65 | 68 |
66 } // namespace content | 69 } // namespace content |
67 | 70 |
68 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | 71 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
OLD | NEW |