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_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 PresentationScreenAvailabilityListener* listener) = 0; | 100 PresentationScreenAvailabilityListener* listener) = 0; |
101 | 101 |
102 // Resets the presentation state for the frame given by |render_process_id| | 102 // Resets the presentation state for the frame given by |render_process_id| |
103 // and |render_frame_id|. | 103 // and |render_frame_id|. |
104 // This unregisters all listeners associated with the given frame, and clears | 104 // This unregisters all listeners associated with the given frame, and clears |
105 // the default presentation URL and ID set for the frame. | 105 // the default presentation URL and ID set for the frame. |
106 virtual void Reset( | 106 virtual void Reset( |
107 int render_process_id, | 107 int render_process_id, |
108 int render_frame_id) = 0; | 108 int render_frame_id) = 0; |
109 | 109 |
110 // Sets the default presentation URL for frame given by |render_process_id| | 110 // Sets the default presentation URLs for frame given by |render_process_id| |
111 // and |render_frame_id|. When the default presentation is started on this | 111 // and |render_frame_id|. When the default presentation is started on this |
112 // frame, |callback| will be invoked with the corresponding | 112 // frame, |callback| will be invoked with the corresponding |
113 // PresentationSessionInfo object. | 113 // PresentationSessionInfo object. |
114 // If |default_presentation_url| is empty, the default presentation URL will | 114 // If |default_presentation_urls| is empty, the default presentation URLs will |
115 // be cleared and the previously registered callback (if any) will be removed. | 115 // be cleared and the previously registered callback (if any) will be removed. |
116 virtual void SetDefaultPresentationUrl( | 116 virtual void SetDefaultPresentationUrls( |
117 int render_process_id, | 117 int render_process_id, |
118 int render_frame_id, | 118 int render_frame_id, |
119 const std::string& default_presentation_url, | 119 const std::vector<std::string>& default_presentation_urls, |
120 const PresentationSessionStartedCallback& callback) = 0; | 120 const PresentationSessionStartedCallback& callback) = 0; |
121 | 121 |
122 // Starts a new presentation session. The presentation id of the session will | 122 // Starts a new presentation session. The presentation id of the session will |
123 // be the default presentation ID if any or a generated one otherwise. | 123 // be the default presentation ID if any or a generated one otherwise. |
124 // Typically, the embedder will allow the user to select a screen to show | 124 // Typically, the embedder will allow the user to select a screen to show |
125 // |presentation_url|. | 125 // one of the |presentation_urls|. |
126 // |render_process_id|, |render_frame_id|: ID of originating frame. | 126 // |render_process_id|, |render_frame_id|: ID of originating frame. |
127 // |presentation_url|: URL of the presentation. | 127 // |presentation_urls|: Possible URLs for the presentation. |
128 // |success_cb|: Invoked with session info, if presentation session started | 128 // |success_cb|: Invoked with session info, if presentation session started |
129 // successfully. | 129 // successfully. |
130 // |error_cb|: Invoked with error reason, if presentation session did not | 130 // |error_cb|: Invoked with error reason, if presentation session did not |
131 // start. | 131 // start. |
132 virtual void StartSession( | 132 virtual void StartSession( |
133 int render_process_id, | 133 int render_process_id, |
134 int render_frame_id, | 134 int render_frame_id, |
135 const std::string& presentation_url, | 135 const std::vector<std::string>& presentation_urls, |
136 const PresentationSessionStartedCallback& success_cb, | 136 const PresentationSessionStartedCallback& success_cb, |
137 const PresentationSessionErrorCallback& error_cb) = 0; | 137 const PresentationSessionErrorCallback& error_cb) = 0; |
138 | 138 |
139 // Joins an existing presentation session. Unlike StartSession(), this | 139 // Joins an existing presentation session. Unlike StartSession(), this |
140 // does not bring a screen list UI. | 140 // does not bring a screen list UI. |
141 // |render_process_id|, |render_frame_id|: ID for originating frame. | 141 // |render_process_id|, |render_frame_id|: ID for originating frame. |
142 // |presentation_url|: URL of the presentation. | 142 // |presentation_urls|: Possible URLs of the presentation. |
143 // |presentation_id|: The ID of the presentation to join. | 143 // |presentation_id|: The ID of the presentation to join. |
144 // |success_cb|: Invoked with session info, if presentation session joined | 144 // |success_cb|: Invoked with session info, if presentation session joined |
145 // successfully. | 145 // successfully. |
146 // |error_cb|: Invoked with error reason, if joining failed. | 146 // |error_cb|: Invoked with error reason, if joining failed. |
147 virtual void JoinSession( | 147 virtual void JoinSession( |
148 int render_process_id, | 148 int render_process_id, |
149 int render_frame_id, | 149 int render_frame_id, |
150 const std::string& presentation_url, | 150 const std::vector<std::string>& presentation_urls, |
151 const std::string& presentation_id, | 151 const std::string& presentation_id, |
152 const PresentationSessionStartedCallback& success_cb, | 152 const PresentationSessionStartedCallback& success_cb, |
153 const PresentationSessionErrorCallback& error_cb) = 0; | 153 const PresentationSessionErrorCallback& error_cb) = 0; |
154 | 154 |
155 // Closes an existing presentation connection. | 155 // Closes an existing presentation connection. |
156 // |render_process_id|, |render_frame_id|: ID for originating frame. | 156 // |render_process_id|, |render_frame_id|: ID for originating frame. |
157 // |presentation_id|: The ID of the presentation to close. | 157 // |presentation_id|: The ID of the presentation to close. |
158 virtual void CloseConnection(int render_process_id, | 158 virtual void CloseConnection(int render_process_id, |
159 int render_frame_id, | 159 int render_frame_id, |
160 const std::string& presentation_id) = 0; | 160 const std::string& presentation_id) = 0; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 virtual void ListenForConnectionStateChange( | 198 virtual void ListenForConnectionStateChange( |
199 int render_process_id, | 199 int render_process_id, |
200 int render_frame_id, | 200 int render_frame_id, |
201 const PresentationSessionInfo& connection, | 201 const PresentationSessionInfo& connection, |
202 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0; | 202 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0; |
203 }; | 203 }; |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
206 | 206 |
207 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ | 207 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ |
OLD | NEW |