| 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_CREATE_PRESENTATION_CONNECTION_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } // namespace url | 25 } // namespace url |
| 26 | 26 |
| 27 namespace media_router { | 27 namespace media_router { |
| 28 | 28 |
| 29 class RouteRequestResult; | 29 class RouteRequestResult; |
| 30 | 30 |
| 31 // Holds parameters for creating a presentation. A request object is created by | 31 // Holds parameters for creating a presentation. A request object is created by |
| 32 // presentation_service_delegate_impl, which is then passed to and owned by the | 32 // presentation_service_delegate_impl, which is then passed to and owned by the |
| 33 // MediaRouterUI. |success_cb| will be invoked when create-session succeeds, or | 33 // MediaRouterUI. |success_cb| will be invoked when create-session succeeds, or |
| 34 // |error_cb| will be invoked when create-session fails or the UI closes. | 34 // |error_cb| will be invoked when create-session fails or the UI closes. |
| 35 // TODO(mfoltz): Combine this with PresentationRequest as it's largely |
| 36 // redundant. |
| 35 class CreatePresentationConnectionRequest { | 37 class CreatePresentationConnectionRequest { |
| 36 public: | 38 public: |
| 37 using PresentationConnectionCallback = | 39 using PresentationConnectionCallback = |
| 38 base::Callback<void(const content::PresentationInfo&, const MediaRoute&)>; | 40 base::Callback<void(const content::PresentationInfo&, const MediaRoute&)>; |
| 39 using PresentationConnectionErrorCallback = | 41 using PresentationConnectionErrorCallback = |
| 40 content::PresentationConnectionErrorCallback; | 42 content::PresentationConnectionErrorCallback; |
| 41 // |presentation_url|: The presentation URL of the request. Must be a valid | 43 // |presentation_url|: The presentation URL of the request. Must be a valid |
| 42 // URL. | 44 // URL. |
| 43 // |frame_origin|: The origin of the frame that initiated the presentation | 45 // |frame_origin|: The origin of the frame that initiated the presentation |
| 44 // request. | 46 // request. |
| 45 // |success_cb|: Callback to invoke when the request succeeds. Must be valid. | 47 // |success_cb|: Callback to invoke when the request succeeds. Must be valid. |
| 46 // |erorr_cb|: Callback to invoke when the request fails. Must be valid. | 48 // |error_cb|: Callback to invoke when the request fails. Must be valid. |
| 47 CreatePresentationConnectionRequest( | 49 CreatePresentationConnectionRequest( |
| 48 const RenderFrameHostId& render_frame_host_id, | 50 const RenderFrameHostId& render_frame_host_id, |
| 49 const std::vector<GURL>& presentation_urls, | 51 const std::vector<GURL>& presentation_urls, |
| 50 const url::Origin& frame_origin, | 52 const url::Origin& frame_origin, |
| 51 const PresentationConnectionCallback& success_cb, | 53 const PresentationConnectionCallback& success_cb, |
| 52 const PresentationConnectionErrorCallback& error_cb); | 54 const PresentationConnectionErrorCallback& error_cb); |
| 53 ~CreatePresentationConnectionRequest(); | 55 ~CreatePresentationConnectionRequest(); |
| 54 | 56 |
| 55 const PresentationRequest& presentation_request() const { | 57 const PresentationRequest& presentation_request() const { |
| 56 return presentation_request_; | 58 return presentation_request_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 74 PresentationConnectionCallback success_cb_; | 76 PresentationConnectionCallback success_cb_; |
| 75 PresentationConnectionErrorCallback error_cb_; | 77 PresentationConnectionErrorCallback error_cb_; |
| 76 bool cb_invoked_; | 78 bool cb_invoked_; |
| 77 | 79 |
| 78 DISALLOW_COPY_AND_ASSIGN(CreatePresentationConnectionRequest); | 80 DISALLOW_COPY_AND_ASSIGN(CreatePresentationConnectionRequest); |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } // namespace media_router | 83 } // namespace media_router |
| 82 | 84 |
| 83 #endif // CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_ | 85 #endif // CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_CONNECTION_REQUEST_H_ |
| OLD | NEW |