Commit 18a7a68f authored by Shane Fitzpatrick's avatar Shane Fitzpatrick Committed by Chromium LUCI CQ

[Nearby] Use correct url for 'learn more' links.

Fixed: 1157108
Change-Id: I25e82866706a81d579c338e15a1cdfd011e5d2a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2594092Reviewed-by: default avatarJames Vecore <vecore@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Shane Fitzpatrick <shanefitz@google.com>
Cr-Commit-Position: refs/heads/master@{#837822}
parent 29e5ffa2
......@@ -182,9 +182,8 @@
<template is="dom-if" if="[[!errorTitle_]]">
<div id="help">
<iron-icon id="infoIcon" icon="nearby20:info"></iron-icon>
<!-- TODO(crbug.com/1157108): add correct url for learn more link -->
<div id="helpText"
inner-h-t-m-l="[[getAriaLabelledHelpText_('https://google.com')]]">
inner-h-t-m-l="[[getAriaLabelledHelpText_()]]">
</div>
</div>
</template>
......
......@@ -355,17 +355,17 @@ Polymer({
/**
* Builds the html for the help text, applying the appropriate aria labels,
* and setting the href of the link to |linkUrl|. This function is largely
* and setting the href of the link. This function is largely
* copied from getAriaLabelledContent_ in <settings-localized-link>, which
* can't be used directly because this isn't part of settings.
* TODO(crbug.com/1154718): Extract this logic into a general method.
* @param {string} linkUrl
* @return {string}
* @private
*/
getAriaLabelledHelpText_(linkUrl) {
getAriaLabelledHelpText_() {
const tempEl = document.createElement('div');
const localizedString = this.i18nAdvanced('nearbyShareDiscoveryPageInfo');
const linkUrl = this.i18n('nearbyShareLearnMoreLink');
tempEl.innerHTML = localizedString;
const ariaLabelledByIds = [];
......@@ -405,11 +405,8 @@ Polymer({
'nearbyShareDiscoveryPageInfo should contain exactly one anchor tag');
const anchorTag = anchorTags[0];
anchorTag.setAttribute('aria-labelledby', ariaLabelledByIds.join(' '));
if (linkUrl != '') {
anchorTag.href = linkUrl;
anchorTag.target = '_blank';
}
anchorTag.href = linkUrl;
anchorTag.target = '_blank';
return tempEl.innerHTML;
},
......
......@@ -39,8 +39,7 @@ Polymer({
/** @private */
onManageContacts_() {
// TODO(crbug.com/1157108): this is not a final link
window.open('https://contacts.google.com', '_blank');
window.open(this.i18n('nearbyShareManageContactsUrl'), '_blank');
},
});
......@@ -80,10 +80,9 @@
remainingTimeInSeconds_, shutoffTimestamp)]]">
<iron-icon id="infoIcon" icon="nearby20:info"></iron-icon>
<div id="helpText">
<!-- TODO(crbug.com/1157108): add correct learn more url -->
<settings-localized-link
localized-string="$i18n{nearbyShareHighVisibilityHelpText}"
link-url="https://google.com">
link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link>
</div>
</template>
......@@ -97,10 +96,9 @@
<div id="errorTitle" aria-hidden="true">
$i18n{nearbyShareErrorTimeOut}
</div>
<!-- TODO(crbug.com/1157108): add correct learn more url -->
<settings-localized-link
localized-string="$i18n{nearbyShareHighVisibilityTimeoutText}"
link-url="https://google.com">
link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link>
</div>
</div>
......
......@@ -124,10 +124,9 @@
</div>
<div id="highVisibilitySubtitle"
class="secondary" aria-hidden="true">
<!-- TODO(vecore) add correct help link -->
<settings-localized-link id="highVisibilityOff"
localized-string="[[getHighVisibilityToggleText_(inHighVisibility_)]]"
link-url="https://google.com">
link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link>
</div>
</div>
......@@ -182,10 +181,9 @@
</template>
<div id="help" class="settings-box">
<iron-icon id="helpIcon" icon="nearby20:info"></iron-icon>
<!-- TODO(crbug.com/1157108) add correct help link -->
<settings-localized-link id="helpText"
localized-string="$i18n{nearbyShareSettingsHelpCaption}"
link-url="https://google.com">
link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link>
</div>
<template is="dom-if" if="[[showReceiveDialog_]]" restamp>
......
......@@ -8,7 +8,9 @@
#include "base/containers/span.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "ui/base/webui/web_ui_util.h"
......@@ -111,4 +113,11 @@ void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) {
{"nearbyShareReceiveConfirmPageConnectionId",
IDS_NEARBY_RECEIVE_CONFIRM_PAGE_CONNECTION_ID}};
webui::AddLocalizedStringsBulk(data_source, kLocalizedStrings);
data_source->AddString("nearbyShareLearnMoreLink",
base::ASCIIToUTF16(chrome::kNearbyShareLearnMoreURL));
data_source->AddString(
"nearbyShareManageContactsUrl",
base::ASCIIToUTF16(chrome::kNearbyShareManageContactsURL));
}
......@@ -301,14 +301,10 @@ void AddNearbyShareData(content::WebUIDataSource* html_source) {
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString("nearbyShareManageContactsUrl",
chrome::kNearbyShareManageContactsURL);
html_source->AddBoolean(
"nearbySharingFeatureFlag",
base::FeatureList::IsEnabled(features::kNearbySharing));
html_source->AddString("nearbyShareLearnMoreLink",
base::ASCIIToUTF16(chrome::kNearbyShareLearnMoreURL));
// To use lottie, the worker-src CSP needs to be updated for the web ui that
// is using it. Since as of now there are only a couple of webuis using
// lottie animations, this update has to be performed manually. As the usage
......
......@@ -419,8 +419,8 @@ const char kTabletModeGesturesLearnMoreURL[] =
const char kWifiSyncLearnMoreURL[] =
"https://support.google.com/chromebook/?p=wifisync";
// TODO(michaelcheco): Update temporary url.
const char kNearbyShareLearnMoreURL[] = "https://google.com/";
const char kNearbyShareLearnMoreURL[] =
"https://support.google.com/chromebook?p=nearby_share";
extern const char kNearbyShareManageContactsURL[] =
"https://contacts.google.com";
......
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