[Media Router] Custom Controls 2 - add MediaRouter::GetRouteController()

Desktop / Chromium - takumif [chromium.org] - 18 April 2017 01:29 EDT

This CL adds GetRouteController() to the MediaRouter API. The method returns a scoped_refptr to a MediaRouteController that is connected to the MediaController in the component extension.

MediaRouterMojoImpl will keep a map of raw pointers to MediaRouteControllers that are valid and are owned by their observers. MediaRouterMojoImpl is notified when a controller is invalidated, so that it can be removed from the map.

GetRouteController() will be called in the next CL by MediaRouterUI for instantiating an observer for MediaRouteController.

We also add two methods to the MediaRouteProvider mojo interface that are called by GetRouteController():- CreateMediaRouteController(): called for creating the extension-side MediaController.- SetMediaRouteStatusObserver(): called for setting the browser-side MediaRouteController as a status observer.

The Chromium-side implementation of custom controls will be done in these patches: 1. Mojo/MediaStatus/MediaRouteController: http://crrev/2727123002 2. MediaRouter::GetRouteController(): this patch 3. MRUI/MRWebUIMessageHandler: http://crrev/2731033002 4. Custom controls WebUI: http://crrev/2725503002

Custom controls design doc: https://docs.google.com/document/d/1_8QxdFIiiJX39jR1Wi1Zn9FW-Y66EMvX1GmQZvjN4G0/edit

BUG=684635

Review-Url: https://codereview.chromium.org/2728543009 Cr-Commit-Position: refs/heads/master@{#465148}

3c8ebf9 [Media Router] Custom Controls 2 - add MediaRouter::GetRouteController()
chrome/browser/media/router/media_router.h | 13 ++
chrome/browser/media/router/media_router_base.cc | 17 ++
chrome/browser/media/router/media_router_base.h | 10 ++
chrome/browser/media/router/mock_media_router.h | 7 +
.../media/router/mojo/media_route_controller.cc | 60 +++++--
.../media/router/mojo/media_route_controller.h | 45 +++--
.../router/mojo/media_route_controller_unittest.cc | 72 +++++---
.../browser/media/router/mojo/media_router.mojom | 22 ++-
.../media/router/mojo/media_router_mojo_impl.cc | 169 +++++++++++++------
.../media/router/mojo/media_router_mojo_impl.h | 34 +++-
.../router/mojo/media_router_mojo_impl_unittest.cc | 187 +++++++++++++++++++--
.../media/router/mojo/media_router_mojo_metrics.h | 3 +-
.../media/router/mojo/media_router_mojo_test.cc | 22 +++
.../media/router/mojo/media_router_mojo_test.h | 46 ++++-
tools/metrics/histograms/histograms.xml | 1 +
15 files changed, 592 insertions(+), 116 deletions(-)

Upstream: git.chromium.org


  • Share