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