| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 static void BindToRequest( | 54 static void BindToRequest( |
| 55 const std::string& extension_id, | 55 const std::string& extension_id, |
| 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 GURL& origin, |
| 65 int tab_id, |
| 64 const MediaRouteResponseCallback& callback) override; | 66 const MediaRouteResponseCallback& callback) override; |
| 67 void JoinRoute(const MediaSource::Id& source_id, |
| 68 const std::string& presentation_id, |
| 69 const GURL& origin, |
| 70 int tab_id, |
| 71 const MediaRouteResponseCallback& callback) override; |
| 65 void CloseRoute(const MediaRoute::Id& route_id) override; | 72 void CloseRoute(const MediaRoute::Id& route_id) override; |
| 66 void PostMessage(const MediaRoute::Id& route_id, | 73 void PostMessage(const MediaRoute::Id& route_id, |
| 67 const std::string& message) override; | 74 const std::string& message) override; |
| 68 void ClearIssue(const Issue::Id& issue_id) override; | 75 void ClearIssue(const Issue::Id& issue_id) override; |
| 69 void RegisterMediaSinksObserver(MediaSinksObserver* observer) override; | 76 void RegisterMediaSinksObserver(MediaSinksObserver* observer) override; |
| 70 void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override; | 77 void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override; |
| 71 void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override; | 78 void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override; |
| 72 void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override; | 79 void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override; |
| 73 void AddIssuesObserver(IssuesObserver* observer) override; | 80 void AddIssuesObserver(IssuesObserver* observer) override; |
| 74 void RemoveIssuesObserver(IssuesObserver* observer) override; | 81 void RemoveIssuesObserver(IssuesObserver* observer) override; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 102 // Runs a closure if the extension monitored by |extension_monitor_| is | 109 // Runs a closure if the extension monitored by |extension_monitor_| is |
| 103 // active, or defers it for later execution if the extension is suspended. | 110 // active, or defers it for later execution if the extension is suspended. |
| 104 void RunOrDefer(const base::Closure& request); | 111 void RunOrDefer(const base::Closure& request); |
| 105 | 112 |
| 106 // Dispatches the Mojo requests queued in |pending_requests_|. | 113 // Dispatches the Mojo requests queued in |pending_requests_|. |
| 107 void ExecutePendingRequests(); | 114 void ExecutePendingRequests(); |
| 108 | 115 |
| 109 // These calls invoke methods in the component extension via Mojo. | 116 // These calls invoke methods in the component extension via Mojo. |
| 110 void DoCreateRoute(const MediaSource::Id& source_id, | 117 void DoCreateRoute(const MediaSource::Id& source_id, |
| 111 const MediaSink::Id& sink_id, | 118 const MediaSink::Id& sink_id, |
| 119 const std::string& origin, |
| 120 int tab_id, |
| 112 const MediaRouteResponseCallback& callback); | 121 const MediaRouteResponseCallback& callback); |
| 122 void DoJoinRoute(const MediaSource::Id& source_id, |
| 123 const std::string& presentation_id, |
| 124 const std::string& origin, |
| 125 int tab_id, |
| 126 const MediaRouteResponseCallback& callback); |
| 113 void DoCloseRoute(const MediaRoute::Id& route_id); | 127 void DoCloseRoute(const MediaRoute::Id& route_id); |
| 114 void DoPostMessage(const MediaRoute::Id& route_id, | 128 void DoPostMessage(const MediaRoute::Id& route_id, |
| 115 const std::string& message); | 129 const std::string& message); |
| 116 void DoClearIssue(const Issue::Id& issue_id); | 130 void DoClearIssue(const Issue::Id& issue_id); |
| 117 void DoStartObservingMediaSinks(const std::string& source_id); | 131 void DoStartObservingMediaSinks(const MediaSource::Id& source_id); |
| 118 void DoStopObservingMediaSinks(const std::string& source_id); | 132 void DoStopObservingMediaSinks(const MediaSource::Id& source_id); |
| 119 void DoStartObservingMediaRoutes(); | 133 void DoStartObservingMediaRoutes(); |
| 120 void DoStopObservingMediaRoutes(); | 134 void DoStopObservingMediaRoutes(); |
| 121 void DoStartObservingIssues(); | 135 void DoStartObservingIssues(); |
| 122 void DoStopObservingIssues(); | 136 void DoStopObservingIssues(); |
| 123 | 137 |
| 124 // mojo::ErrorHandler implementation. | 138 // mojo::ErrorHandler implementation. |
| 125 void OnConnectionError() override; | 139 void OnConnectionError() override; |
| 126 | 140 |
| 127 // interfaces::MediaRouterObserver implementation. | 141 // interfaces::MediaRouterObserver implementation. |
| 128 void ProvideMediaRouter( | 142 void ProvideMediaRouter( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 std::string instance_id_; | 185 std::string instance_id_; |
| 172 | 186 |
| 173 base::ThreadChecker thread_checker_; | 187 base::ThreadChecker thread_checker_; |
| 174 | 188 |
| 175 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 189 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
| 176 }; | 190 }; |
| 177 | 191 |
| 178 } // namespace media_router | 192 } // namespace media_router |
| 179 | 193 |
| 180 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ | 194 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_H_ |
| OLD | NEW |