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

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

Issue 2558963003: Add GetCurrentRoutes() to MediaRouter API, ensure dialog has routes at init (Closed)
Patch Set: Created 4 years 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 <vector> 9 #include <vector>
10 10
(...skipping 14 matching lines...) Expand all
25 std::unique_ptr<PresentationConnectionStateSubscription> 25 std::unique_ptr<PresentationConnectionStateSubscription>
26 AddPresentationConnectionStateChangedCallback( 26 AddPresentationConnectionStateChangedCallback(
27 const MediaRoute::Id& route_id, 27 const MediaRoute::Id& route_id,
28 const content::PresentationConnectionStateChangedCallback& callback) 28 const content::PresentationConnectionStateChangedCallback& callback)
29 override; 29 override;
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;
36
35 protected: 37 protected:
36 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest, 38 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
37 PresentationConnectionStateChangedCallback); 39 PresentationConnectionStateChangedCallback);
38 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest, 40 FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoImplTest,
39 PresentationConnectionStateChangedCallbackRemoved); 41 PresentationConnectionStateChangedCallbackRemoved);
40 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, CreatePresentationIds); 42 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, CreatePresentationIds);
41 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, NotifyCallbacks); 43 FRIEND_TEST_ALL_PREFIXES(MediaRouterBaseTest, NotifyCallbacks);
42 44
43 MediaRouterBase(); 45 MediaRouterBase();
44 46
(...skipping 14 matching lines...) Expand all
59 61
60 using PresentationConnectionStateChangedCallbacks = base::CallbackList<void( 62 using PresentationConnectionStateChangedCallbacks = base::CallbackList<void(
61 const content::PresentationConnectionStateChangeInfo&)>; 63 const content::PresentationConnectionStateChangeInfo&)>;
62 64
63 base::ScopedPtrHashMap< 65 base::ScopedPtrHashMap<
64 MediaRoute::Id, 66 MediaRoute::Id,
65 std::unique_ptr<PresentationConnectionStateChangedCallbacks>> 67 std::unique_ptr<PresentationConnectionStateChangedCallbacks>>
66 presentation_connection_state_callbacks_; 68 presentation_connection_state_callbacks_;
67 69
68 private: 70 private:
71 friend class MediaRouterBaseTest;
69 friend class MediaRouterFactory; 72 friend class MediaRouterFactory;
70 friend class MediaRouterMojoTest; 73 friend class MediaRouterMojoTest;
71 74
72 class InternalMediaRoutesObserver; 75 class InternalMediaRoutesObserver;
73 76
74 // Must be called before invoking any other method. 77 // Must be called before invoking any other method.
75 void Initialize(); 78 void Initialize();
76 79
77 // Called when a PresentationConnectionStateChangedCallback associated with 80 // Called when a PresentationConnectionStateChangedCallback associated with
78 // |route_id| is removed from |presentation_connection_state_callbacks_|. 81 // |route_id| is removed from |presentation_connection_state_callbacks_|.
79 void OnPresentationConnectionStateCallbackRemoved( 82 void OnPresentationConnectionStateCallbackRemoved(
80 const MediaRoute::Id& route_id); 83 const MediaRoute::Id& route_id);
81 84
82 // KeyedService 85 // KeyedService
83 void Shutdown() override; 86 void Shutdown() override;
84 87
85 std::unique_ptr<InternalMediaRoutesObserver> internal_routes_observer_; 88 std::unique_ptr<InternalMediaRoutesObserver> internal_routes_observer_;
86 bool initialized_; 89 bool initialized_;
87 90
88 DISALLOW_COPY_AND_ASSIGN(MediaRouterBase); 91 DISALLOW_COPY_AND_ASSIGN(MediaRouterBase);
89 }; 92 };
90 93
91 } // namespace media_router 94 } // namespace media_router
92 95
93 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_ 96 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698