Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: chrome/browser/media/router/media_router_base.h

Issue 2951523002: Media Remoting: Add mojo interfaces between browser and extension. (Closed)
Patch Set: Addressed imcheng's comments. Removed OnStarted/Failed interface. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BASE_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <vector> 10 #include <vector>
(...skipping 19 matching lines...) Expand all
30 30
31 // Called when the incognito profile for this instance is being shut down. 31 // Called when the incognito profile for this instance is being shut down.
32 // This will terminate all incognito media routes. 32 // This will terminate all incognito media routes.
33 void OnIncognitoProfileShutdown() override; 33 void OnIncognitoProfileShutdown() override;
34 34
35 std::vector<MediaRoute> GetCurrentRoutes() const override; 35 std::vector<MediaRoute> GetCurrentRoutes() const override;
36 36
37 scoped_refptr<MediaRouteController> GetRouteController( 37 scoped_refptr<MediaRouteController> GetRouteController(
38 const MediaRoute::Id& route_id) override; 38 const MediaRoute::Id& route_id) override;
39 39
40 void RegisterRemotingSource(int32_t tab_id,
41 CastRemotingConnector* remoting_source) override;
42 void UnregisterRemotingSource(int32_t tab_id) override;
43
40 protected: 44 protected:
41 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest, 45 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
42 PresentationConnectionStateChangedCallback); 46 PresentationConnectionStateChangedCallback);
43 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest, 47 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
44 PresentationConnectionStateChangedCallbackRemoved); 48 PresentationConnectionStateChangedCallbackRemoved);
45 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, CreatePresentationIds); 49 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, CreatePresentationIds);
46 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, NotifyCallbacks); 50 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, NotifyCallbacks);
47 51
48 MediaRouterBase(); 52 MediaRouterBase();
49 53
(...skipping 16 matching lines...) Expand all
66 bool IsRouteKnown(const std::string& route_id) const; 70 bool IsRouteKnown(const std::string& route_id) const;
67 71
68 using PresentationConnectionStateChangedCallbacks = base::CallbackList<void( 72 using PresentationConnectionStateChangedCallbacks = base::CallbackList<void(
69 const content::PresentationConnectionStateChangeInfo&)>; 73 const content::PresentationConnectionStateChangeInfo&)>;
70 74
71 std::unordered_map< 75 std::unordered_map<
72 MediaRoute::Id, 76 MediaRoute::Id,
73 std::unique_ptr<PresentationConnectionStateChangedCallbacks>> 77 std::unique_ptr<PresentationConnectionStateChangedCallbacks>>
74 presentation_connection_state_callbacks_; 78 presentation_connection_state_callbacks_;
75 79
80 // Stores CastRemotingConnectors that can be connected to the MediaRemoter
81 // for media remoting when MediaRemoter is started. The map uses the tab ID
82 // as the key.
83 std::unordered_map<int32_t, CastRemotingConnector*> remoting_sources_;
84
76 private: 85 private:
77 friend class MediaRouterBaseTest; 86 friend class MediaRouterBaseTest;
78 friend class MediaRouterFactory; 87 friend class MediaRouterFactory;
79 friend class MediaRouterMojoTest; 88 friend class MediaRouterMojoTest;
80 89
81 class InternalMediaRoutesObserver; 90 class InternalMediaRoutesObserver;
82 91
83 // Must be called before invoking any other method. 92 // Must be called before invoking any other method.
84 void Initialize(); 93 void Initialize();
85 94
(...skipping 11 matching lines...) Expand all
97 106
98 std::unique_ptr<InternalMediaRoutesObserver> internal_routes_observer_; 107 std::unique_ptr<InternalMediaRoutesObserver> internal_routes_observer_;
99 bool initialized_; 108 bool initialized_;
100 109
101 DISALLOW_COPY_AND_ASSIGN(MediaRouterBase); 110 DISALLOW_COPY_AND_ASSIGN(MediaRouterBase);
102 }; 111 };
103 112
104 } // namespace media_router 113 } // namespace media_router
105 114
106 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_ 115 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698