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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_ |
| 7 |
| 8 #include "base/callback_list.h" |
| 9 #include "base/containers/scoped_ptr_hash_map.h" |
| 10 #include "base/macros.h" |
| 11 #include "base/threading/thread_checker.h" |
| 12 #include "chrome/browser/media/router/media_router.h" |
| 13 |
| 14 namespace media_router { |
| 15 |
| 16 class MediaRouterBase : public MediaRouter { |
| 17 public: |
| 18 MediaRouterBase(); |
| 19 ~MediaRouterBase() override; |
| 20 |
| 21 scoped_ptr<PresentationConnectionStateSubscription> |
| 22 AddPresentationConnectionStateChangedCallback( |
| 23 const MediaRoute::Id& route_id, |
| 24 const content::PresentationConnectionStateChangedCallback& callback) |
| 25 override; |
| 26 |
| 27 protected: |
| 28 void NotifyPresentationConnectionStateChange( |
| 29 const MediaRoute::Id& route_id, |
| 30 content::PresentationConnectionState state); |
| 31 |
| 32 using PresentationConnectionStateChangedCallbacks = |
| 33 base::CallbackList<void(content::PresentationConnectionState)>; |
| 34 base::ScopedPtrHashMap< |
| 35 MediaRoute::Id, |
| 36 scoped_ptr<PresentationConnectionStateChangedCallbacks>> |
| 37 presentation_connection_state_callbacks_; |
| 38 |
| 39 base::ThreadChecker thread_checker_; |
| 40 |
| 41 private: |
| 42 // Called when a PresentationConnectionStateChangedCallback associated with |
| 43 // |route_id| is removed from |presentation_connection_state_callbacks_|. |
| 44 void OnPresentationConnectionStateCallbackRemoved( |
| 45 const MediaRoute::Id& route_id); |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(MediaRouterBase); |
| 48 }; |
| 49 |
| 50 } // namespace media_router |
| 51 |
| 52 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_ |
OLD | NEW |