| 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 CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void SendMessage( | 96 void SendMessage( |
| 97 int render_process_id, | 97 int render_process_id, |
| 98 int render_frame_id, | 98 int render_frame_id, |
| 99 scoped_ptr<content::PresentationSessionMessage> message_request, | 99 scoped_ptr<content::PresentationSessionMessage> message_request, |
| 100 const SendMessageCallback& send_message_cb) override; | 100 const SendMessageCallback& send_message_cb) override; |
| 101 void ListenForSessionStateChange( | 101 void ListenForSessionStateChange( |
| 102 int render_process_id, | 102 int render_process_id, |
| 103 int render_frame_id, | 103 int render_frame_id, |
| 104 const content::SessionStateChangedCallback& state_changed_cb) override; | 104 const content::SessionStateChangedCallback& state_changed_cb) override; |
| 105 | 105 |
| 106 // Callback invoked when a |route| has been created or joined outside of a | 106 // Callback invoked when there is a route response from CreateRoute/JoinRoute |
| 107 // Presentation API request. The route could be due to | 107 // outside of a Presentation API request. This could be due to |
| 108 // browser action (e.g., browser initiated media router dialog) or | 108 // browser action (e.g., browser initiated media router dialog) or |
| 109 // a media route provider (e.g., autojoin). | 109 // a media route provider (e.g., autojoin). |
| 110 void OnRouteCreated(const MediaRoute& route); | 110 void OnRouteResponse(const MediaRoute* route, const std::string& error); |
| 111 | 111 |
| 112 // Returns the default MediaSource for this tab if there is one. | 112 // Returns the default MediaSource for this tab if there is one. |
| 113 // Returns an empty MediaSource otherwise. | 113 // Returns an empty MediaSource otherwise. |
| 114 MediaSource default_source() const { return default_source_; } | 114 MediaSource default_source() const { return default_source_; } |
| 115 | 115 |
| 116 content::WebContents* web_contents() const { return web_contents_; } | 116 content::WebContents* web_contents() const { return web_contents_; } |
| 117 const GURL& default_frame_url() const { return default_frame_url_; } | 117 const GURL& default_frame_url() const { return default_frame_url_; } |
| 118 | 118 |
| 119 // Observer interface for listening to default MediaSource changes for the | 119 // Observer interface for listening to default MediaSource changes for the |
| 120 // WebContents. | 120 // WebContents. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Returns |listener|'s presentation URL as a MediaSource. If |listener| does | 153 // Returns |listener|'s presentation URL as a MediaSource. If |listener| does |
| 154 // not have a persentation URL, returns the tab mirroring MediaSource. | 154 // not have a persentation URL, returns the tab mirroring MediaSource. |
| 155 MediaSource GetMediaSourceFromListener( | 155 MediaSource GetMediaSourceFromListener( |
| 156 content::PresentationScreenAvailabilityListener* listener); | 156 content::PresentationScreenAvailabilityListener* listener); |
| 157 | 157 |
| 158 void OnJoinRouteResponse(int render_process_id, | 158 void OnJoinRouteResponse(int render_process_id, |
| 159 int render_frame_id, | 159 int render_frame_id, |
| 160 const content::PresentationSessionInfo& session, | 160 const content::PresentationSessionInfo& session, |
| 161 const PresentationSessionSuccessCallback& success_cb, | 161 const PresentationSessionSuccessCallback& success_cb, |
| 162 const PresentationSessionErrorCallback& error_cb, | 162 const PresentationSessionErrorCallback& error_cb, |
| 163 scoped_ptr<MediaRoute> route, | 163 const MediaRoute* route, |
| 164 const std::string& error_text); | 164 const std::string& error_text); |
| 165 | 165 |
| 166 void OnStartSessionSucceeded( | 166 void OnStartSessionSucceeded( |
| 167 int render_process_id, | 167 int render_process_id, |
| 168 int render_frame_id, | 168 int render_frame_id, |
| 169 const PresentationSessionSuccessCallback& success_cb, | 169 const PresentationSessionSuccessCallback& success_cb, |
| 170 const content::PresentationSessionInfo& new_session, | 170 const content::PresentationSessionInfo& new_session, |
| 171 const MediaRoute::Id& route_id); | 171 const MediaRoute::Id& route_id); |
| 172 | 172 |
| 173 // Returns |true| if the frame is the main frame of |web_contents_|. | 173 // Returns |true| if the frame is the main frame of |web_contents_|. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 196 scoped_ptr<PresentationFrameManager> frame_manager_; | 196 scoped_ptr<PresentationFrameManager> frame_manager_; |
| 197 | 197 |
| 198 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; | 198 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; |
| 199 | 199 |
| 200 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); | 200 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 } // namespace media_router | 203 } // namespace media_router |
| 204 | 204 |
| 205 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ | 205 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ |
| OLD | NEW |