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 @@ ...@@ -182,9 +182,8 @@
<template is="dom-if" if="[[!errorTitle_]]"> <template is="dom-if" if="[[!errorTitle_]]">
<div id="help"> <div id="help">
<iron-icon id="infoIcon" icon="nearby20:info"></iron-icon> <iron-icon id="infoIcon" icon="nearby20:info"></iron-icon>
<!-- TODO(crbug.com/1157108): add correct url for learn more link -->
<div id="helpText" <div id="helpText"
inner-h-t-m-l="[[getAriaLabelledHelpText_('https://google.com')]]"> inner-h-t-m-l="[[getAriaLabelledHelpText_()]]">
</div> </div>
</div> </div>
</template> </template>
......
...@@ -355,17 +355,17 @@ Polymer({ ...@@ -355,17 +355,17 @@ Polymer({
/** /**
* Builds the html for the help text, applying the appropriate aria labels, * 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 * copied from getAriaLabelledContent_ in <settings-localized-link>, which
* can't be used directly because this isn't part of settings. * can't be used directly because this isn't part of settings.
* TODO(crbug.com/1154718): Extract this logic into a general method. * TODO(crbug.com/1154718): Extract this logic into a general method.
* @param {string} linkUrl
* @return {string} * @return {string}
* @private * @private
*/ */
getAriaLabelledHelpText_(linkUrl) { getAriaLabelledHelpText_() {
const tempEl = document.createElement('div'); const tempEl = document.createElement('div');
const localizedString = this.i18nAdvanced('nearbyShareDiscoveryPageInfo'); const localizedString = this.i18nAdvanced('nearbyShareDiscoveryPageInfo');
const linkUrl = this.i18n('nearbyShareLearnMoreLink');
tempEl.innerHTML = localizedString; tempEl.innerHTML = localizedString;
const ariaLabelledByIds = []; const ariaLabelledByIds = [];
...@@ -405,11 +405,8 @@ Polymer({ ...@@ -405,11 +405,8 @@ Polymer({
'nearbyShareDiscoveryPageInfo should contain exactly one anchor tag'); 'nearbyShareDiscoveryPageInfo should contain exactly one anchor tag');
const anchorTag = anchorTags[0]; const anchorTag = anchorTags[0];
anchorTag.setAttribute('aria-labelledby', ariaLabelledByIds.join(' ')); anchorTag.setAttribute('aria-labelledby', ariaLabelledByIds.join(' '));
anchorTag.href = linkUrl;
if (linkUrl != '') { anchorTag.target = '_blank';
anchorTag.href = linkUrl;
anchorTag.target = '_blank';
}
return tempEl.innerHTML; return tempEl.innerHTML;
}, },
......
...@@ -39,8 +39,7 @@ Polymer({ ...@@ -39,8 +39,7 @@ Polymer({
/** @private */ /** @private */
onManageContacts_() { onManageContacts_() {
// TODO(crbug.com/1157108): this is not a final link window.open(this.i18n('nearbyShareManageContactsUrl'), '_blank');
window.open('https://contacts.google.com', '_blank');
}, },
}); });
...@@ -80,10 +80,9 @@ ...@@ -80,10 +80,9 @@
remainingTimeInSeconds_, shutoffTimestamp)]]"> remainingTimeInSeconds_, shutoffTimestamp)]]">
<iron-icon id="infoIcon" icon="nearby20:info"></iron-icon> <iron-icon id="infoIcon" icon="nearby20:info"></iron-icon>
<div id="helpText"> <div id="helpText">
<!-- TODO(crbug.com/1157108): add correct learn more url -->
<settings-localized-link <settings-localized-link
localized-string="$i18n{nearbyShareHighVisibilityHelpText}" localized-string="$i18n{nearbyShareHighVisibilityHelpText}"
link-url="https://google.com"> link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link> </settings-localized-link>
</div> </div>
</template> </template>
...@@ -97,10 +96,9 @@ ...@@ -97,10 +96,9 @@
<div id="errorTitle" aria-hidden="true"> <div id="errorTitle" aria-hidden="true">
$i18n{nearbyShareErrorTimeOut} $i18n{nearbyShareErrorTimeOut}
</div> </div>
<!-- TODO(crbug.com/1157108): add correct learn more url -->
<settings-localized-link <settings-localized-link
localized-string="$i18n{nearbyShareHighVisibilityTimeoutText}" localized-string="$i18n{nearbyShareHighVisibilityTimeoutText}"
link-url="https://google.com"> link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link> </settings-localized-link>
</div> </div>
</div> </div>
......
...@@ -124,10 +124,9 @@ ...@@ -124,10 +124,9 @@
</div> </div>
<div id="highVisibilitySubtitle" <div id="highVisibilitySubtitle"
class="secondary" aria-hidden="true"> class="secondary" aria-hidden="true">
<!-- TODO(vecore) add correct help link -->
<settings-localized-link id="highVisibilityOff" <settings-localized-link id="highVisibilityOff"
localized-string="[[getHighVisibilityToggleText_(inHighVisibility_)]]" localized-string="[[getHighVisibilityToggleText_(inHighVisibility_)]]"
link-url="https://google.com"> link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link> </settings-localized-link>
</div> </div>
</div> </div>
...@@ -182,10 +181,9 @@ ...@@ -182,10 +181,9 @@
</template> </template>
<div id="help" class="settings-box"> <div id="help" class="settings-box">
<iron-icon id="helpIcon" icon="nearby20:info"></iron-icon> <iron-icon id="helpIcon" icon="nearby20:info"></iron-icon>
<!-- TODO(crbug.com/1157108) add correct help link -->
<settings-localized-link id="helpText" <settings-localized-link id="helpText"
localized-string="$i18n{nearbyShareSettingsHelpCaption}" localized-string="$i18n{nearbyShareSettingsHelpCaption}"
link-url="https://google.com"> link-url="$i18n{nearbyShareLearnMoreLink}">
</settings-localized-link> </settings-localized-link>
</div> </div>
<template is="dom-if" if="[[showReceiveDialog_]]" restamp> <template is="dom-if" if="[[showReceiveDialog_]]" restamp>
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
#include "base/containers/span.h" #include "base/containers/span.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/webui/webui_util.h" #include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "ui/base/webui/web_ui_util.h" #include "ui/base/webui/web_ui_util.h"
...@@ -111,4 +113,11 @@ void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) { ...@@ -111,4 +113,11 @@ void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) {
{"nearbyShareReceiveConfirmPageConnectionId", {"nearbyShareReceiveConfirmPageConnectionId",
IDS_NEARBY_RECEIVE_CONFIRM_PAGE_CONNECTION_ID}}; IDS_NEARBY_RECEIVE_CONFIRM_PAGE_CONNECTION_ID}};
webui::AddLocalizedStringsBulk(data_source, kLocalizedStrings); 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) { ...@@ -301,14 +301,10 @@ void AddNearbyShareData(content::WebUIDataSource* html_source) {
AddLocalizedStringsBulk(html_source, kLocalizedStrings); AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString("nearbyShareManageContactsUrl",
chrome::kNearbyShareManageContactsURL);
html_source->AddBoolean( html_source->AddBoolean(
"nearbySharingFeatureFlag", "nearbySharingFeatureFlag",
base::FeatureList::IsEnabled(features::kNearbySharing)); 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 // 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 // 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 // lottie animations, this update has to be performed manually. As the usage
......
...@@ -419,8 +419,8 @@ const char kTabletModeGesturesLearnMoreURL[] = ...@@ -419,8 +419,8 @@ const char kTabletModeGesturesLearnMoreURL[] =
const char kWifiSyncLearnMoreURL[] = const char kWifiSyncLearnMoreURL[] =
"https://support.google.com/chromebook/?p=wifisync"; "https://support.google.com/chromebook/?p=wifisync";
// TODO(michaelcheco): Update temporary url. const char kNearbyShareLearnMoreURL[] =
const char kNearbyShareLearnMoreURL[] = "https://google.com/"; "https://support.google.com/chromebook?p=nearby_share";
extern const char kNearbyShareManageContactsURL[] = extern const char kNearbyShareManageContactsURL[] =
"https://contacts.google.com"; "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