| 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_SESSION_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/media/router/media_route.h" | 10 #include "chrome/browser/media/router/media_route.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 const MediaSource& GetMediaSource() const { return media_source_; } | 46 const MediaSource& GetMediaSource() const { return media_source_; } |
| 47 | 47 |
| 48 const GURL& frame_url() const { return frame_url_; } | 48 const GURL& frame_url() const { return frame_url_; } |
| 49 const content::PresentationSessionInfo& presentation_info() const { | 49 const content::PresentationSessionInfo& presentation_info() const { |
| 50 return presentation_info_; | 50 return presentation_info_; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // Invokes |success_cb_| or |error_cb_| with the given arguments. | 53 // Invokes |success_cb_| or |error_cb_| with the given arguments. |
| 54 // These functions can only be invoked once per instance. Further invocations | 54 // These functions can only be invoked once per instance. Further invocations |
| 55 // are no-op. | 55 // are no-op. |
| 56 void MaybeInvokeSuccessCallback(const MediaRoute::Id& route_id); | 56 void MaybeInvokeSuccessCallback(const std::string& presentation_id, |
| 57 const MediaRoute::Id& route_id); |
| 57 void MaybeInvokeErrorCallback(const content::PresentationError& error); | 58 void MaybeInvokeErrorCallback(const content::PresentationError& error); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 content::PresentationSessionInfo presentation_info_; | 61 content::PresentationSessionInfo presentation_info_; |
| 61 MediaSource media_source_; | 62 MediaSource media_source_; |
| 62 GURL frame_url_; | 63 GURL frame_url_; |
| 63 PresentationSessionSuccessCallback success_cb_; | 64 PresentationSessionSuccessCallback success_cb_; |
| 64 PresentationSessionErrorCallback error_cb_; | 65 PresentationSessionErrorCallback error_cb_; |
| 65 bool cb_invoked_; | 66 bool cb_invoked_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(CreatePresentationSessionRequest); | 68 DISALLOW_COPY_AND_ASSIGN(CreatePresentationSessionRequest); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace media_router | 71 } // namespace media_router |
| 71 | 72 |
| 72 #endif // CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_ | 73 #endif // CHROME_BROWSER_MEDIA_ROUTER_CREATE_PRESENTATION_SESSION_REQUEST_H_ |
| OLD | NEW |