forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Media Router] Custom Controls 4 - Implement details view WebUI
This CL adds a built-in alternative to the extensionview controller in the route details view of the media router dialog WebUI. The WebUI route controller is functionally equivalent to the extensionview controller. Whenever the WebUI is notified by the browser process of updates to the media status of the shown route, the details view is updated. Whenever the user interacts with the media controls on the details view, the media commands are sent to the browser process. The switch to the WebUI controller is managed by a Finch experiment that is currently disabled, so this CL has no behavioral change. Its functionality can be checked out with the flag --enable-features=MediaRouterUIRouteController. Before-and-after screenshots: https://docs.google.com/document/d/1v8jGV33FiFtH_qs2_Ui0UNubt1nHRN_CBrHLt1wRXF0 The Chromium-side implementation of custom controls will be done in these patches: 1. Mojo/MediaStatus/MediaRouteController: http://crrev/2727123002 2. MediaRouter::GetRouteController(): http://crrev/2728543009 3. MRUI/MRWebUIMessageHandler: http://crrev/2731033002 4. Custom controls WebUI: this patch Custom controls design doc: https://docs.google.com/document/d/1_8QxdFIiiJX39jR1Wi1Zn9FW-Y66EMvX1GmQZvjN4G0/edit [1] https://codereview.chromium.org/2724513002/ BUG=684633 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2725503002 Cr-Commit-Position: refs/heads/master@{#475667}
- Loading branch information
Showing
34 changed files
with
1,757 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 155 additions & 0 deletions
155
...esources/media_router/elements/media_router_container/media_router_container_interface.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
// Copyright 2017 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. | ||
|
||
/** | ||
* This Polymer element contains the entire media router interface. It handles | ||
* hiding and showing specific components. | ||
* @record | ||
*/ | ||
function MediaRouterContainerInterface() {} | ||
|
||
/** | ||
* The list of available sinks. | ||
* @type {!Array<!media_router.Sink>} | ||
*/ | ||
MediaRouterContainerInterface.prototype.allSinks; | ||
|
||
/** | ||
* The list of CastModes to show. | ||
* @type {!Array<!media_router.CastMode>|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.castModeList; | ||
|
||
/** | ||
* The URL to open when the device missing link is clicked. | ||
* @type {string|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.deviceMissingUrl; | ||
|
||
/** | ||
* The URL to open when the cloud services pref learn more link is clicked. | ||
* @type {string|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.firstRunFlowCloudPrefLearnMoreUrl; | ||
|
||
/** | ||
* The URL to open when the first run flow learn more link is clicked. | ||
* @type {string|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.firstRunFlowLearnMoreUrl; | ||
|
||
/** | ||
* The header text for the sink list. | ||
* @type {string|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.headerText; | ||
|
||
/** | ||
* The header text tooltip. This would be descriptive of the | ||
* source origin, whether a host name, tab URL, etc. | ||
* @type {string|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.headerTextTooltip; | ||
|
||
/** | ||
* The issue to show. | ||
* @type {?media_router.Issue} | ||
*/ | ||
MediaRouterContainerInterface.prototype.issue; | ||
|
||
/** | ||
* The list of current routes. | ||
* @type {!Array<!media_router.Route>|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.routeList; | ||
|
||
/** | ||
* Whether the search input should be padded as if it were at the bottom of | ||
* the dialog. | ||
* @type {boolean} | ||
*/ | ||
MediaRouterContainerInterface.prototype.searchUseBottomPadding; | ||
|
||
/** | ||
* Whether to show the user domain of sinks associated with identity. | ||
* @type {boolean|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.showDomain; | ||
|
||
/** | ||
* Whether to show the first run flow. | ||
* @type {boolean|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.showFirstRunFlow; | ||
|
||
/** | ||
* Whether to show the cloud preference setting in the first run flow. | ||
* @type {boolean|undefined} | ||
*/ | ||
MediaRouterContainerInterface.prototype.showFirstRunFlowCloudPref; | ||
|
||
/** | ||
* Whether the WebUI route controls should be shown instead of the | ||
* extensionview in the route details view. | ||
* @type {boolean} | ||
*/ | ||
MediaRouterContainerInterface.prototype.useWebUiRouteControls; | ||
|
||
/** | ||
* Fires a 'report-initial-action' event when the user takes their first | ||
* action after the dialog opens. Also fires a 'report-initial-action-close' | ||
* event if that initial action is to close the dialog. | ||
* @param {!media_router.MediaRouterUserAction} initialAction | ||
*/ | ||
MediaRouterContainerInterface.prototype.maybeReportUserFirstAction = function( | ||
initialAction) {}; | ||
|
||
/** | ||
* Updates |currentView_| if the dialog had just opened and there's | ||
* only one local route. | ||
*/ | ||
MediaRouterContainerInterface.prototype.maybeShowRouteDetailsOnOpen = | ||
function() {}; | ||
|
||
/** | ||
* Handles response of previous create route attempt. | ||
* @param {string} sinkId The ID of the sink to which the Media Route was | ||
* creating a route. | ||
* @param {?media_router.Route} route The newly created route that | ||
* corresponds to the sink if route creation succeeded; null otherwise. | ||
* @param {boolean} isForDisplay Whether or not |route| is for display. | ||
*/ | ||
MediaRouterContainerInterface.prototype.onCreateRouteResponseReceived = | ||
function(sinkId, route, isForDisplay) {}; | ||
|
||
/** | ||
* Called when a search has completed up to route creation. |sinkId| | ||
* identifies the sink that should be in |allSinks|, if a sink was found. | ||
* @param {string} sinkId The ID of the sink that is the result of the | ||
* currently pending search. | ||
*/ | ||
MediaRouterContainerInterface.prototype.onReceiveSearchResult = function( | ||
sinkId) {}; | ||
|
||
/** | ||
* Called when the connection to the route controller is invalidated. Switches | ||
* from route details view to the sink list view. | ||
*/ | ||
MediaRouterContainerInterface.prototype.onRouteControllerInvalidated = | ||
function() {}; | ||
|
||
/** | ||
* Sets the selected cast mode to the one associated with |castModeType|, | ||
* and rebuilds sinks to reflect the change. | ||
* @param {number} castModeType The type of the selected cast mode. | ||
*/ | ||
MediaRouterContainerInterface.prototype.selectCastMode = function( | ||
castModeType) {}; | ||
|
||
/** | ||
* Update the max dialog height and update the positioning of the elements. | ||
* @param {number} height The max height of the Media Router dialog. | ||
*/ | ||
MediaRouterContainerInterface.prototype.updateMaxDialogHeight = function( | ||
height) {}; |
25 changes: 25 additions & 0 deletions
25
chrome/browser/resources/media_router/elements/route_controls/compiled_resources2.gyp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2017 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. | ||
{ | ||
'targets': [ | ||
{ | ||
'target_name': 'route_controls', | ||
'dependencies': [ | ||
'../../compiled_resources2.gyp:media_router_browser_api', | ||
'../../compiled_resources2.gyp:media_router_data', | ||
'../../compiled_resources2.gyp:media_router_ui_interface', | ||
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', | ||
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', | ||
], | ||
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'], | ||
}, | ||
{ | ||
'target_name': 'route_controls_interface', | ||
'dependencies': [ | ||
'../../compiled_resources2.gyp:media_router_data', | ||
], | ||
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'], | ||
}, | ||
], | ||
} |
Oops, something went wrong.