OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/media/router/media_router_impl.h" |
| 6 |
| 7 #include <set> |
| 8 |
| 9 #include "base/bind.h" |
| 10 #include "base/logging.h" |
| 11 #include "base/stl_util.h" |
| 12 #include "chrome/browser/media/router/media_route.h" |
| 13 #include "chrome/browser/media/router/media_routes_observer.h" |
| 14 #include "chrome/browser/media/router/media_sink.h" |
| 15 #include "chrome/browser/media/router/media_sinks_observer.h" |
| 16 #include "chrome/browser/media/router/media_source.h" |
| 17 #include "chrome/browser/media/router/media_source_helper.h" |
| 18 |
| 19 namespace media_router { |
| 20 |
| 21 MediaRouterImpl::MediaRouterImpl() : provider_manager_host_(nullptr) {} |
| 22 |
| 23 MediaRouterImpl::~MediaRouterImpl() {} |
| 24 |
| 25 void MediaRouterImpl::Initialize( |
| 26 MediaRouteProviderManagerHost* provider_manager_host) { |
| 27 DCHECK(!provider_manager_host_); |
| 28 DCHECK(provider_manager_host); |
| 29 provider_manager_host_ = provider_manager_host; |
| 30 } |
| 31 |
| 32 // TODO(imcheng): Implement NOTIMPLEMENTED() methods. |
| 33 bool MediaRouterImpl::RegisterMediaSinksObserver( |
| 34 MediaSinksObserver* observer) { |
| 35 NOTIMPLEMENTED(); |
| 36 // TODO(imcheng): Set registered_ bit on |observer| to true on success. |
| 37 return false; |
| 38 } |
| 39 |
| 40 void MediaRouterImpl::UnregisterMediaSinksObserver( |
| 41 MediaSinksObserver* observer) { |
| 42 NOTIMPLEMENTED(); |
| 43 observer->registered_ = false; |
| 44 } |
| 45 |
| 46 void MediaRouterImpl::PostMessage( |
| 47 const MediaRouteId& route_id, |
| 48 const std::string& message) { |
| 49 NOTIMPLEMENTED(); |
| 50 } |
| 51 |
| 52 void MediaRouterImpl::OnMessage(const MediaRouteId& route_id, |
| 53 const std::string& message) { |
| 54 NOTIMPLEMENTED(); |
| 55 } |
| 56 |
| 57 void MediaRouterImpl::OnSinksReceived( |
| 58 const MediaSource& source, |
| 59 const std::vector<MediaSink>& sinks) { |
| 60 NOTIMPLEMENTED(); |
| 61 } |
| 62 |
| 63 RouteRequestId MediaRouterImpl::StartRouteRequest( |
| 64 const MediaSource& source, |
| 65 const MediaSinkId& sink_id, |
| 66 const MediaRouteResponseCallback& callback) { |
| 67 NOTIMPLEMENTED(); |
| 68 return kInvalidRouteRequestId; |
| 69 } |
| 70 |
| 71 void MediaRouterImpl::CloseRoute(const MediaRouteId& route_id) { |
| 72 NOTIMPLEMENTED(); |
| 73 } |
| 74 |
| 75 void MediaRouterImpl::UnregisterMediaRouteResponseCallback( |
| 76 const RouteRequestId& request_id) { |
| 77 NOTIMPLEMENTED(); |
| 78 } |
| 79 |
| 80 bool MediaRouterImpl::RegisterMediaRoutesObserver( |
| 81 MediaRoutesObserver* observer) { |
| 82 NOTIMPLEMENTED(); |
| 83 // TODO(imcheng): Set registered_ bit on |observer| to true on success. |
| 84 return false; |
| 85 } |
| 86 |
| 87 void MediaRouterImpl::UnregisterMediaRoutesObserver( |
| 88 MediaRoutesObserver* observer) { |
| 89 NOTIMPLEMENTED(); |
| 90 observer->registered_ = false; |
| 91 } |
| 92 |
| 93 void MediaRouterImpl::OnRouteResponseReceived( |
| 94 const RouteRequestId& request_id, |
| 95 const MediaRoute& route) { |
| 96 NOTIMPLEMENTED(); |
| 97 } |
| 98 |
| 99 void MediaRouterImpl::OnRouteResponseError(const RouteRequestId& request_id, |
| 100 const std::string& error_text) { |
| 101 NOTIMPLEMENTED(); |
| 102 } |
| 103 |
| 104 void MediaRouterImpl::OnRoutesUpdated( |
| 105 const std::vector<MediaRoute>& routes, |
| 106 const std::vector<MediaSink>& sinks) { |
| 107 NOTIMPLEMENTED(); |
| 108 } |
| 109 |
| 110 void MediaRouterImpl::OnHostDestroyed(MediaRouteProviderManagerHost* host) { |
| 111 DCHECK(host == provider_manager_host_); |
| 112 provider_manager_host_ = nullptr; |
| 113 } |
| 114 |
| 115 } // namespace media_router |
OLD | NEW |