| 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_MEDIA_ROUTER_MOJO_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 content::BrowserContext* context, | 56 content::BrowserContext* context, |
| 57 mojo::InterfaceRequest<interfaces::MediaRouterObserver> request); | 57 mojo::InterfaceRequest<interfaces::MediaRouterObserver> request); |
| 58 | 58 |
| 59 // MediaRouter implementation. | 59 // MediaRouter implementation. |
| 60 // Execution of the requests is delegated to the Do* methods, which can be | 60 // Execution of the requests is delegated to the Do* methods, which can be |
| 61 // enqueued for later use if the extension is temporarily suspended. | 61 // enqueued for later use if the extension is temporarily suspended. |
| 62 void CreateRoute(const MediaSource::Id& source_id, | 62 void CreateRoute(const MediaSource::Id& source_id, |
| 63 const MediaSink::Id& sink_id, | 63 const MediaSink::Id& sink_id, |
| 64 const MediaRouteResponseCallback& callback) override; | 64 const MediaRouteResponseCallback& callback) override; |
| 65 void CloseRoute(const MediaRoute::Id& route_id) override; | 65 void CloseRoute(const MediaRoute::Id& route_id) override; |
| 66 void PostMessage(const MediaRoute::Id& route_id, | 66 void SendMessage(const MediaRoute::Id& route_id, |
| 67 const std::string& message) override; | 67 const std::string& message, |
| 68 const SendMessageCallback& callback) override; |
| 68 void ClearIssue(const Issue::Id& issue_id) override; | 69 void ClearIssue(const Issue::Id& issue_id) override; |
| 69 void RegisterMediaSinksObserver(MediaSinksObserver* observer) override; | 70 void RegisterMediaSinksObserver(MediaSinksObserver* observer) override; |
| 70 void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override; | 71 void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override; |
| 71 void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override; | 72 void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override; |
| 72 void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override; | 73 void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override; |
| 73 void AddIssuesObserver(IssuesObserver* observer) override; | 74 void AddIssuesObserver(IssuesObserver* observer) override; |
| 74 void RemoveIssuesObserver(IssuesObserver* observer) override; | 75 void RemoveIssuesObserver(IssuesObserver* observer) override; |
| 75 | 76 |
| 76 void set_instance_id_for_test(const std::string& instance_id) { | 77 void set_instance_id_for_test(const std::string& instance_id) { |
| 77 instance_id_ = instance_id; | 78 instance_id_ = instance_id; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 105 | 106 |
| 106 // Dispatches the Mojo requests queued in |pending_requests_|. | 107 // Dispatches the Mojo requests queued in |pending_requests_|. |
| 107 void ExecutePendingRequests(); | 108 void ExecutePendingRequests(); |
| 108 | 109 |
| 109 // These calls invoke methods in the component extension via Mojo. | 110 // These calls invoke methods in the component extension via Mojo. |
| 110 void DoCreateRoute(const MediaSource::Id& source_id, | 111 void DoCreateRoute(const MediaSource::Id& source_id, |
| 111 const MediaSink::Id& sink_id, | 112 const MediaSink::Id& sink_id, |
| 112 const MediaRouteResponseCallback& callback); | 113 const MediaRouteResponseCallback& callback); |
| 113 void DoCloseRoute(const MediaRoute::Id& route_id); | 114 void DoCloseRoute(const MediaRoute::Id& route_id); |
| 114 void DoPostMessage(const MediaRoute::Id& route_id, | 115 void DoPostMessage(const MediaRoute::Id& route_id, |
| 115 const std::string& message); | 116 const std::string& message, |
| 117 const SendMessageCallback& callback); |
| 116 void DoClearIssue(const Issue::Id& issue_id); | 118 void DoClearIssue(const Issue::Id& issue_id); |
| 117 void DoStartObservingMediaSinks(const std::string& source_id); | 119 void DoStartObservingMediaSinks(const std::string& source_id); |
| 118 void DoStopObservingMediaSinks(const std::string& source_id); | 120 void DoStopObservingMediaSinks(const std::string& source_id); |
| 119 void DoStartObservingMediaRoutes(); | 121 void DoStartObservingMediaRoutes(); |
| 120 void DoStopObservingMediaRoutes(); | 122 void DoStopObservingMediaRoutes(); |
| 121 void DoStartObservingIssues(); | 123 void DoStartObservingIssues(); |
| 122 void DoStopObservingIssues(); | 124 void DoStopObservingIssues(); |
| 123 | 125 |
| 124 // mojo::ErrorHandler implementation. | 126 // mojo::ErrorHandler implementation. |
| 125 void OnConnectionError() override; | 127 void OnConnectionError() override; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 std::string instance_id_; | 173 std::string instance_id_; |
| 172 | 174 |
| 173 base::ThreadChecker thread_checker_; | 175 base::ThreadChecker thread_checker_; |
| 174 | 176 |
| 175 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 177 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 } // namespace media_router | 180 } // namespace media_router |
| 179 | 181 |
| 180 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ | 182 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ |
| OLD | NEW |