| Index: chrome/browser/media/router/media_router_base.h
|
| diff --git a/chrome/browser/media/router/media_router_base.h b/chrome/browser/media/router/media_router_base.h
|
| index e95fa177cdab3b2951b6f97b4bfdfa6375e82dd7..933f840de134a797bd056899ebc683180174eee3 100644
|
| --- a/chrome/browser/media/router/media_router_base.h
|
| +++ b/chrome/browser/media/router/media_router_base.h
|
| @@ -6,21 +6,21 @@
|
| #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_
|
|
|
| #include <set>
|
| +#include <vector>
|
|
|
| #include "base/callback_list.h"
|
| #include "base/containers/scoped_ptr_hash_map.h"
|
| #include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "base/threading/thread_checker.h"
|
| +#include "chrome/browser/media/router/media_route.h"
|
| #include "chrome/browser/media/router/media_router.h"
|
| -
|
| -class Profile;
|
| +#include "chrome/browser/media/router/media_routes_observer.h"
|
|
|
| namespace media_router {
|
|
|
| class MediaRouterBase : public MediaRouter {
|
| public:
|
| - MediaRouterBase();
|
| ~MediaRouterBase() override;
|
|
|
| std::unique_ptr<PresentationConnectionStateSubscription>
|
| @@ -39,6 +39,8 @@ class MediaRouterBase : public MediaRouter {
|
| FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
|
| PresentationConnectionStateChangedCallbackRemoved);
|
|
|
| + MediaRouterBase();
|
| +
|
| // Generates a unique presentation id. Shared between Android and desktop.
|
| static std::string CreatePresentationId();
|
|
|
| @@ -50,13 +52,12 @@ class MediaRouterBase : public MediaRouter {
|
| content::PresentationConnectionCloseReason reason,
|
| const std::string& message);
|
|
|
| - // Called when off the record route |route_id| has been created.
|
| - void OnOffTheRecordRouteCreated(const MediaRoute::Id& route_id);
|
| - // Called when route |route_id| has been terminated.
|
| - void OnRouteTerminated(const MediaRoute::Id& route_id);
|
| + // Returns true when there is at least one MediaRoute with is_local = true.
|
| + bool HasLocalRoute() const;
|
|
|
| using PresentationConnectionStateChangedCallbacks = base::CallbackList<void(
|
| const content::PresentationConnectionStateChangeInfo&)>;
|
| +
|
| base::ScopedPtrHashMap<
|
| MediaRoute::Id,
|
| std::unique_ptr<PresentationConnectionStateChangedCallbacks>>
|
| @@ -65,13 +66,24 @@ class MediaRouterBase : public MediaRouter {
|
| base::ThreadChecker thread_checker_;
|
|
|
| private:
|
| + friend class MediaRouterFactory;
|
| + friend class MediaRouterMojoTest;
|
| +
|
| + class InternalMediaRoutesObserver;
|
| +
|
| + // Must be called before invoking any other method.
|
| + void Initialize();
|
| +
|
| // Called when a PresentationConnectionStateChangedCallback associated with
|
| // |route_id| is removed from |presentation_connection_state_callbacks_|.
|
| void OnPresentationConnectionStateCallbackRemoved(
|
| const MediaRoute::Id& route_id);
|
|
|
| - // Ids of current off the record media routes.
|
| - std::set<MediaRoute::Id> off_the_record_route_ids_;
|
| + // KeyedService
|
| + void Shutdown() override;
|
| +
|
| + std::unique_ptr<InternalMediaRoutesObserver> internal_routes_observer_;
|
| + bool initialized_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MediaRouterBase);
|
| };
|
|
|