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

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

Issue 1020743003: [Media Router] Design MediaRouter interface with stub implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move MRPMH::Delegate inheritence from MR to MRImpl Created 5 years, 9 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
(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_EXTENSION_MEDIA_ROUTE_PROVIDER_MANAGER_HOST_ H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_EXTENSION_MEDIA_ROUTE_PROVIDER_MANAGER_HOST_ H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "chrome/browser/media/router/media_route_provider_manager_host.h"
12 #include "components/keyed_service/core/keyed_service.h"
13
14 namespace content {
15 class BrowserContext;
16 } // namespace content
17
18 namespace media_router {
19
20 // MediaRouteProviderManagerHost implementation that sits between
Kevin M 2015/03/26 20:50:14 I think that this might be diving into the details
imcheng 2015/03/26 23:33:12 Ok, I will just replace the entire comment block w
21 // the Media Router and MediaRouterApiImpl (another MRPMH implementation).
22 // This class serves the following purposes:
23 // - Accepts Media Router related requests that needs to be forwarded to MRPM.
24 // Thus this class implements MediaRouteProviderManagerHost.
25 // - Retains ownership of MediaRouterApiImpl, a MediaRouteProviderManagerHost
26 // implementation that talks to an event-page based MRPM component extension.
27 // This class encapsulates logic for reactivating the event page and queueing
28 // of requests to be executed once event page is reactivated. These logic are
29 // isolated from the Media Router as they are event page implementation
30 // details and should be transparent to Media Router.
31 // - Relays data from MediaRouterApiImpl back to the Media Router, hence it
32 // implements MediaRouteProviderManagerHost::Delegate.
Kevin M 2015/03/26 20:50:14 Still applicable?
imcheng 2015/03/26 23:33:12 Removed.
33 // See MediaRouterApiImpl for more information.
34 // TODO(imcheng): Define MediaRouterApiImpl.
35 class ExtensionMediaRouteProviderManagerHost
36 : public MediaRouteProviderManagerHost,
37 public KeyedService {
38 public:
39 ~ExtensionMediaRouteProviderManagerHost() override;
40
41 // MediaRouteProviderManagerHost
42 void AddMediaSinksQuery(const MediaSource& source) override;
43 void RemoveMediaSinksQuery(const MediaSource& source) override;
44 void RequestRoute(const RouteRequestId& request_id,
45 const MediaSource& source,
46 const MediaSinkId& sink_id) override;
47 void CloseRoute(const MediaRouteId& route_id) override;
48 void PostMessage(const MediaRouteId& route_id,
49 const std::string& message,
50 const std::string& extra_info_json) override;
51 void StartMediaRoutesQuery() override;
52 void StopMediaRoutesQuery() override;
53
54 private:
55 friend class ExtensionMRPMHostFactory;
56
57 // Private ctor. To instantiate, call
58 // ExtensionMRPMHostFactory::GetMRPMHostForBrowserContext.
59 explicit ExtensionMediaRouteProviderManagerHost(
60 content::BrowserContext* context,
61 MediaRouteProviderManagerHost::Delegate* delegate);
62
63 // Delegate to forward MRPM responses to.
Kevin M 2015/03/26 20:50:14 Delegate to receive MRPM responses?
imcheng 2015/03/26 23:33:12 Done.
64 // Does not own this object.
65 MediaRouteProviderManagerHost::Delegate* delegate_;
66
67 // BrowserContext associated with this instance.
68 content::BrowserContext* context_;
69
70 DISALLOW_COPY_AND_ASSIGN(ExtensionMediaRouteProviderManagerHost);
71 };
72
73 } // namespace media_router
74
75 #endif // CHROME_BROWSER_MEDIA_ROUTER_EXTENSION_MEDIA_ROUTE_PROVIDER_MANAGER_HO ST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698