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

Side by Side Diff: content/renderer/presentation/presentation_dispatcher.h

Issue 2174693004: [Presentation API] Add support to content/ for multiple URLs per PresentationRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <queue> 13 #include <queue>
14 14
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/id_map.h" 16 #include "base/id_map.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
19 #include "content/public/renderer/render_frame_observer.h" 19 #include "content/public/renderer/render_frame_observer.h"
20 #include "mojo/public/cpp/bindings/binding.h" 20 #include "mojo/public/cpp/bindings/binding.h"
21 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio nClient.h" 21 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio nClient.h"
22 #include "third_party/WebKit/public/platform/modules/presentation/presentation.m ojom.h" 22 #include "third_party/WebKit/public/platform/modules/presentation/presentation.m ojom.h"
23 23
24 namespace blink { 24 namespace blink {
25 class WebPresentationAvailabilityObserver; 25 class WebPresentationAvailabilityObserver;
26 class WebString; 26 class WebString;
27 template <typename T>
28 class WebVector;
27 } // namespace blink 29 } // namespace blink
28 30
29 namespace content { 31 namespace content {
30 32
31 // PresentationDispatcher is a delegate for Presentation API messages used by 33 // PresentationDispatcher is a delegate for Presentation API messages used by
32 // Blink. It forwards the calls to the Mojo PresentationService. 34 // Blink. It forwards the calls to the Mojo PresentationService.
33 class CONTENT_EXPORT PresentationDispatcher 35 class CONTENT_EXPORT PresentationDispatcher
34 : public RenderFrameObserver, 36 : public RenderFrameObserver,
35 public NON_EXPORTED_BASE(blink::WebPresentationClient), 37 public NON_EXPORTED_BASE(blink::WebPresentationClient),
36 public NON_EXPORTED_BASE(blink::mojom::PresentationServiceClient) { 38 public NON_EXPORTED_BASE(blink::mojom::PresentationServiceClient) {
(...skipping 18 matching lines...) Expand all
55 static SendMessageRequest* CreateSendBinaryMessageRequest( 57 static SendMessageRequest* CreateSendBinaryMessageRequest(
56 const blink::WebString& presentationUrl, 58 const blink::WebString& presentationUrl,
57 const blink::WebString& presentationId, 59 const blink::WebString& presentationId,
58 blink::mojom::PresentationMessageType type, 60 blink::mojom::PresentationMessageType type,
59 const uint8_t* data, 61 const uint8_t* data,
60 size_t length); 62 size_t length);
61 63
62 // WebPresentationClient implementation. 64 // WebPresentationClient implementation.
63 void setController(blink::WebPresentationController* controller) override; 65 void setController(blink::WebPresentationController* controller) override;
64 void startSession( 66 void startSession(
65 const blink::WebString& presentationUrl, 67 const blink::WebVector<blink::WebString>& presentationUrls,
66 blink::WebPresentationConnectionClientCallbacks* callback) override; 68 blink::WebPresentationConnectionClientCallbacks* callback) override;
67 void joinSession( 69 void joinSession(
68 const blink::WebString& presentationUrl, 70 const blink::WebVector<blink::WebString>& presentationUrls,
69 const blink::WebString& presentationId, 71 const blink::WebString& presentationId,
70 blink::WebPresentationConnectionClientCallbacks* callback) override; 72 blink::WebPresentationConnectionClientCallbacks* callback) override;
71 void sendString(const blink::WebString& presentationUrl, 73 void sendString(const blink::WebString& presentationUrl,
72 const blink::WebString& presentationId, 74 const blink::WebString& presentationId,
73 const blink::WebString& message) override; 75 const blink::WebString& message) override;
74 void sendArrayBuffer(const blink::WebString& presentationUrl, 76 void sendArrayBuffer(const blink::WebString& presentationUrl,
75 const blink::WebString& presentationId, 77 const blink::WebString& presentationId,
76 const uint8_t* data, 78 const uint8_t* data,
77 size_t length) override; 79 size_t length) override;
78 void sendBlobData(const blink::WebString& presentationUrl, 80 void sendBlobData(const blink::WebString& presentationUrl,
79 const blink::WebString& presentationId, 81 const blink::WebString& presentationId,
80 const uint8_t* data, 82 const uint8_t* data,
81 size_t length) override; 83 size_t length) override;
82 void closeSession(const blink::WebString& presentationUrl, 84 void closeSession(const blink::WebString& presentationUrl,
83 const blink::WebString& presentationId) override; 85 const blink::WebString& presentationId) override;
84 void terminateSession(const blink::WebString& presentationUrl, 86 void terminateSession(const blink::WebString& presentationUrl,
85 const blink::WebString& presentationId) override; 87 const blink::WebString& presentationId) override;
86 void getAvailability( 88 void getAvailability(
87 const blink::WebString& availabilityUrl, 89 const blink::WebString& availabilityUrl,
88 blink::WebPresentationAvailabilityCallbacks* callbacks) override; 90 blink::WebPresentationAvailabilityCallbacks* callbacks) override;
89 void startListening(blink::WebPresentationAvailabilityObserver*) override; 91 void startListening(blink::WebPresentationAvailabilityObserver*) override;
90 void stopListening(blink::WebPresentationAvailabilityObserver*) override; 92 void stopListening(blink::WebPresentationAvailabilityObserver*) override;
91 void setDefaultPresentationUrl(const blink::WebString& url) override; 93 void setDefaultPresentationUrls(
94 const blink::WebVector<blink::WebString>& presentationUrls) override;
92 95
93 // RenderFrameObserver implementation. 96 // RenderFrameObserver implementation.
94 void DidCommitProvisionalLoad( 97 void DidCommitProvisionalLoad(
95 bool is_new_navigation, 98 bool is_new_navigation,
96 bool is_same_page_navigation) override; 99 bool is_same_page_navigation) override;
97 void OnDestruct() override; 100 void OnDestruct() override;
98 101
99 // blink::mojom::PresentationServiceClient 102 // blink::mojom::PresentationServiceClient
100 void OnScreenAvailabilityNotSupported(const std::string& url) override; 103 void OnScreenAvailabilityNotSupported(const GURL& url) override;
101 void OnScreenAvailabilityUpdated(const std::string& url, 104 void OnScreenAvailabilityUpdated(const GURL& url, bool available) override;
102 bool available) override;
103 void OnConnectionStateChanged( 105 void OnConnectionStateChanged(
104 blink::mojom::PresentationSessionInfoPtr connection, 106 blink::mojom::PresentationSessionInfoPtr connection,
105 blink::mojom::PresentationConnectionState state) override; 107 blink::mojom::PresentationConnectionState state) override;
106 void OnConnectionClosed( 108 void OnConnectionClosed(
107 blink::mojom::PresentationSessionInfoPtr connection, 109 blink::mojom::PresentationSessionInfoPtr connection,
108 blink::mojom::PresentationConnectionCloseReason reason, 110 blink::mojom::PresentationConnectionCloseReason reason,
109 const std::string& message) override; 111 const std::string& message) override;
110 void OnSessionMessagesReceived( 112 void OnSessionMessagesReceived(
111 blink::mojom::PresentationSessionInfoPtr session_info, 113 blink::mojom::PresentationSessionInfoPtr session_info,
112 std::vector<blink::mojom::SessionMessagePtr> messages) override; 114 std::vector<blink::mojom::SessionMessagePtr> messages) override;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // Updates the listening state of availability for |status| and notifies the 169 // Updates the listening state of availability for |status| and notifies the
168 // client. 170 // client.
169 void UpdateListeningState(AvailabilityStatus* status); 171 void UpdateListeningState(AvailabilityStatus* status);
170 172
171 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher); 173 DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher);
172 }; 174 };
173 175
174 } // namespace content 176 } // namespace content
175 177
176 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ 178 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698