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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/extension_media_route_provider_manager_host.h
diff --git a/chrome/browser/media/router/extension_media_route_provider_manager_host.h b/chrome/browser/media/router/extension_media_route_provider_manager_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b544b9a5d63bebd944fdcdc93a8c87c0261efdf
--- /dev/null
+++ b/chrome/browser/media/router/extension_media_route_provider_manager_host.h
@@ -0,0 +1,75 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_EXTENSION_MEDIA_ROUTE_PROVIDER_MANAGER_HOST_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_EXTENSION_MEDIA_ROUTE_PROVIDER_MANAGER_HOST_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "chrome/browser/media/router/media_route_provider_manager_host.h"
+#include "components/keyed_service/core/keyed_service.h"
+
+namespace content {
+class BrowserContext;
+} // namespace content
+
+namespace media_router {
+
+// 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
+// the Media Router and MediaRouterApiImpl (another MRPMH implementation).
+// This class serves the following purposes:
+// - Accepts Media Router related requests that needs to be forwarded to MRPM.
+// Thus this class implements MediaRouteProviderManagerHost.
+// - Retains ownership of MediaRouterApiImpl, a MediaRouteProviderManagerHost
+// implementation that talks to an event-page based MRPM component extension.
+// This class encapsulates logic for reactivating the event page and queueing
+// of requests to be executed once event page is reactivated. These logic are
+// isolated from the Media Router as they are event page implementation
+// details and should be transparent to Media Router.
+// - Relays data from MediaRouterApiImpl back to the Media Router, hence it
+// implements MediaRouteProviderManagerHost::Delegate.
Kevin M 2015/03/26 20:50:14 Still applicable?
imcheng 2015/03/26 23:33:12 Removed.
+// See MediaRouterApiImpl for more information.
+// TODO(imcheng): Define MediaRouterApiImpl.
+class ExtensionMediaRouteProviderManagerHost
+ : public MediaRouteProviderManagerHost,
+ public KeyedService {
+ public:
+ ~ExtensionMediaRouteProviderManagerHost() override;
+
+ // MediaRouteProviderManagerHost
+ void AddMediaSinksQuery(const MediaSource& source) override;
+ void RemoveMediaSinksQuery(const MediaSource& source) override;
+ void RequestRoute(const RouteRequestId& request_id,
+ const MediaSource& source,
+ const MediaSinkId& sink_id) override;
+ void CloseRoute(const MediaRouteId& route_id) override;
+ void PostMessage(const MediaRouteId& route_id,
+ const std::string& message,
+ const std::string& extra_info_json) override;
+ void StartMediaRoutesQuery() override;
+ void StopMediaRoutesQuery() override;
+
+ private:
+ friend class ExtensionMRPMHostFactory;
+
+ // Private ctor. To instantiate, call
+ // ExtensionMRPMHostFactory::GetMRPMHostForBrowserContext.
+ explicit ExtensionMediaRouteProviderManagerHost(
+ content::BrowserContext* context,
+ MediaRouteProviderManagerHost::Delegate* delegate);
+
+ // 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.
+ // Does not own this object.
+ MediaRouteProviderManagerHost::Delegate* delegate_;
+
+ // BrowserContext associated with this instance.
+ content::BrowserContext* context_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionMediaRouteProviderManagerHost);
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_EXTENSION_MEDIA_ROUTE_PROVIDER_MANAGER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698