Commit 513ca7e4 authored by apacible's avatar apacible Committed by Commit bot

[Media Router] Add cloud services learn more link to first run flow.

Part 5.

This change adds a link target to the "Learn More" text in the cloud services pref section of the first run flow. Also reworked some of the HTML/CSS to make the link clickable.

BUG=560457

Review URL: https://codereview.chromium.org/1606303005

Cr-Commit-Position: refs/heads/master@{#371426}
parent f16ea649
......@@ -73,6 +73,16 @@
z-index: 1;
}
#first-run-flow-cloud-pref {
color: white;
display: flex;
}
#first-run-flow-cloud-pref a {
color: white;
text-decoration: none;
}
#first-run-learn-more {
font-weight: bold;
text-transform: uppercase;
......
......@@ -22,12 +22,18 @@
<div id="first-run-text">[[firstRunFlowText_]]</div>
<template is="dom-if" if="[[showFirstRunFlowCloudPref]]">
<div id="first-run-flow-cloud-pref">
<paper-checkbox checked id="first-run-cloud-checkbox">
<div>
<paper-checkbox checked id="first-run-cloud-checkbox">
</paper-checkbox>
</div>
<div>
<span>[[firstRunFlowCloudPrefText_]]</span>
<span id="first-run-learn-more">
[[firstRunFlowCloudLearnMore_]]
</span>
</paper-checkbox>
<a href="[[firstRunFlowCloudPrefLearnMoreUrl]]">
<span id="first-run-learn-more">
[[firstRunFlowCloudLearnMore_]]
</span>
</a>
</div>
</div>
</template>
<div id="first-run-button-container">
......
......@@ -118,6 +118,15 @@ Polymer({
loadTimeData.getString('firstRunFlowCloudLearnMore') : '',
},
/**
* The URL to open when the cloud services pref learn more link is clicked.
* @type {string}
*/
firstRunFlowCloudPrefLearnMoreUrl: {
type: String,
value: '',
},
/**
* The text for the cloud services preference description in the first run
* flow.
......
......@@ -50,12 +50,15 @@ cr.define('media_router.ui', function() {
/**
* Populates the WebUI with data obtained from Media Router.
*
* @param {{deviceMissingUrl: string,
* @param {{firstRunFlowCloudPrefLearnMoreUrl: string,
* deviceMissingUrl: string,
* sinks: !Array<!media_router.Sink>,
* routes: !Array<!media_router.Route>,
* castModes: !Array<!media_router.CastMode>,
* wasFirstRunFlowAcknowledged: boolean}} data
* Parameters in data:
* firstRunFlowCloudPrefLearnMoreUrl - url to open when the cloud services
* pref learn more link is clicked.
* deviceMissingUrl - url to be opened on "Device missing?" clicked.
* sinks - list of sinks to be displayed.
* routes - list of routes that are associated with the sinks.
......@@ -64,6 +67,8 @@ cr.define('media_router.ui', function() {
* acknowledged by user.
*/
function setInitialData(data) {
container.firstRunFlowCloudPrefLearnMoreUrl =
data['firstRunFlowCloudPrefLearnMoreUrl'];
container.deviceMissingUrl = data['deviceMissingUrl'];
container.castModeList = data['castModes'];
container.allSinks = data['sinks'];
......
......@@ -325,6 +325,11 @@ void MediaRouterWebUIMessageHandler::OnRequestInitialData(
media_router_ui_->OnUIInitiallyLoaded();
base::DictionaryValue initial_data;
#if defined(GOOGLE_CHROME_BUILD)
// "Casting to a Hangout from Chrome" Chromecast help center page.
initial_data.SetString("firstRunFlowCloudPrefLearnMoreUrl",
base::StringPrintf(kHelpPageUrlPrefix, 6320939));
#endif // defined(GOOGLE_CHROME_BUILD)
// "No Cast devices found?" Chromecast help center page.
initial_data.SetString("deviceMissingUrl",
base::StringPrintf(kHelpPageUrlPrefix, 3249268));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment