Commit e9956373 authored by Joon Ahn's avatar Joon Ahn Committed by Chromium LUCI CQ

nearby: receive confirmation strings

String spec "Nearby Share - Receiving - Confirmation"

Bug: n/a
Change-Id: I487c5c991c66eaa75cce9f59ce94e481d3cb57e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586253
Commit-Queue: Jimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: default avatarJames Vecore <vecore@google.com>
Auto-Submit: Joon Ahn <joonbug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836281}
parent 65bd095e
...@@ -110,6 +110,9 @@ ...@@ -110,6 +110,9 @@
<message name="IDS_NEARBY_SHARE_FEATURE_NAME" desc="This is the name of the Nearby Share feature which provides a way for nearby devices to share files, text, and urls"> <message name="IDS_NEARBY_SHARE_FEATURE_NAME" desc="This is the name of the Nearby Share feature which provides a way for nearby devices to share files, text, and urls">
Nearby Share Nearby Share
</message> </message>
<message name="IDS_NEARBY_ACTIONS_ACCEPT" desc="Action button text to accept a transfer in the Nearby Share UI.">
Accept
</message>
<message name="IDS_NEARBY_ACTIONS_CANCEL" desc="Action button text to cancel the current step in the Nearby Share UI."> <message name="IDS_NEARBY_ACTIONS_CANCEL" desc="Action button text to cancel the current step in the Nearby Share UI.">
Cancel Cancel
</message> </message>
...@@ -198,6 +201,9 @@ ...@@ -198,6 +201,9 @@
<message name="IDS_NEARBY_RECEIVE_CONFIRM_PAGE_TITLE" desc="The title of the recieve confirmation page which askign the user to confirm receving a share from a specific device."> <message name="IDS_NEARBY_RECEIVE_CONFIRM_PAGE_TITLE" desc="The title of the recieve confirmation page which askign the user to confirm receving a share from a specific device.">
Receive from this device? Receive from this device?
</message> </message>
<message name="IDS_NEARBY_RECEIVE_CONFIRM_PAGE_CONNECTION_ID" desc="String that describes the secure connection ID which the receiving will happen in.">
Secure connection ID: <ph name="CONNECTION_ID">$1<ex>A392</ex></ph>
</message>
<!-- File Preview Strings --> <!-- File Preview Strings -->
<message name="IDS_NEARBY_PREVIEW_TITLE_MULTIPLE_FILE" desc="The file share preview would show the name of the file being shared, but if multiple files are being shared, we show this description instead. The FILE_COUNT will always be greater than 1, so this string will always be plural."> <message name="IDS_NEARBY_PREVIEW_TITLE_MULTIPLE_FILE" desc="The file share preview would show the name of the file being shared, but if multiple files are being shared, we show this description instead. The FILE_COUNT will always be greater than 1, so this string will always be plural.">
......
864663afceb561372ad4190757deb8073cd26e23
\ No newline at end of file
c3bdf6e2cf10b03db10cd68b9a89cc95fd4caffc
\ No newline at end of file
...@@ -29,6 +29,7 @@ js_library("nearby_share_confirm_page") { ...@@ -29,6 +29,7 @@ js_library("nearby_share_confirm_page") {
"//chrome/browser/resources/nearby_share/shared:nearby_page_template", "//chrome/browser/resources/nearby_share/shared:nearby_page_template",
"//chrome/browser/resources/nearby_share/shared:nearby_preview", "//chrome/browser/resources/nearby_share/shared:nearby_preview",
"//chrome/browser/resources/nearby_share/shared:nearby_progress", "//chrome/browser/resources/nearby_share/shared:nearby_progress",
"//ui/webui/resources/js:i18n_behavior",
] ]
} }
...@@ -168,6 +169,7 @@ js_library("nearby_share_confirm_page.m") { ...@@ -168,6 +169,7 @@ js_library("nearby_share_confirm_page.m") {
"//chrome/browser/resources/nearby_share/shared:nearby_page_template.m", "//chrome/browser/resources/nearby_share/shared:nearby_page_template.m",
"//chrome/browser/resources/nearby_share/shared:nearby_preview.m", "//chrome/browser/resources/nearby_share/shared:nearby_preview.m",
"//chrome/browser/resources/nearby_share/shared:nearby_progress.m", "//chrome/browser/resources/nearby_share/shared:nearby_progress.m",
"//ui/webui/resources/js:i18n_behavior.m",
] ]
extra_deps = [ ":nearby_share_confirm_page_module" ] extra_deps = [ ":nearby_share_confirm_page_module" ]
} }
......
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
} }
</style> </style>
<nearby-page-template title="$i18n{nearbyShareReceiveConfirmPageTitle}" <nearby-page-template title="$i18n{nearbyShareReceiveConfirmPageTitle}"
action-button-label="$i18n{confirm}" action-button-label="$i18n{nearbyShareActionsAccept}"
action-button-event-name="confirm" action-button-event-name="accept"
cancel-button-label="$i18n{cancel}" cancel-button-label="$i18n{cancel}"
cancel-button-event-name="reject" cancel-button-event-name="reject"
close-only="[[errorTitle_]]"> close-only="[[errorTitle_]]">
...@@ -73,7 +73,9 @@ ...@@ -73,7 +73,9 @@
<div id="processRowContent"> <div id="processRowContent">
<!-- TODO(vecore): Replace with real ui. --> <!-- TODO(vecore): Replace with real ui. -->
<div id="shareTargetName">[[shareTarget.name]]</div> <div id="shareTargetName">[[shareTarget.name]]</div>
<div id="connectionToken">[[connectionToken]]</div> <div id="connectionToken">
[[getConnectionTokenString_(connectionToken)]]
</div>
</div> </div>
</div> </div>
......
...@@ -85,4 +85,15 @@ Polymer({ ...@@ -85,4 +85,15 @@ Polymer({
this.errorDescription = null; this.errorDescription = null;
} }
}, },
/**
* @return {string}
* @protected
*/
getConnectionTokenString_() {
return this.connectionToken ?
this.i18n(
'nearbyShareReceiveConfirmPageConnectionId', this.connectionToken) :
'';
},
}); });
...@@ -66,9 +66,9 @@ Polymer({ ...@@ -66,9 +66,9 @@ Polymer({
}, },
listeners: { listeners: {
'change-page': 'onChangePage_', 'accept': 'onAccept_',
'cancel': 'onCancel_', 'cancel': 'onCancel_',
'confirm': 'onConfirm_', 'change-page': 'onChangePage_',
'onboarding-complete': 'onOnboardingComplete_', 'onboarding-complete': 'onOnboardingComplete_',
'reject': 'onReject_', 'reject': 'onReject_',
}, },
...@@ -288,7 +288,7 @@ Polymer({ ...@@ -288,7 +288,7 @@ Polymer({
}, },
/** @private */ /** @private */
onConfirm_() { onAccept_() {
assert(this.shareTarget); assert(this.shareTarget);
this.receiveManager_.accept(this.shareTarget.id).then((success) => { this.receiveManager_.accept(this.shareTarget.id).then((success) => {
if (success) { if (success) {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) { void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) {
static constexpr webui::LocalizedString kLocalizedStrings[] = { static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"nearbyShareAccountRowLabel", IDS_NEARBY_ACCOUNT_ROW_LABEL}, {"nearbyShareAccountRowLabel", IDS_NEARBY_ACCOUNT_ROW_LABEL},
{"nearbyShareActionsAccept", IDS_NEARBY_ACTIONS_ACCEPT},
{"nearbyShareActionsCancel", IDS_NEARBY_ACTIONS_CANCEL}, {"nearbyShareActionsCancel", IDS_NEARBY_ACTIONS_CANCEL},
{"nearbyShareActionsClose", IDS_NEARBY_ACTIONS_CLOSE}, {"nearbyShareActionsClose", IDS_NEARBY_ACTIONS_CLOSE},
{"nearbyShareActionsConfirm", IDS_NEARBY_ACTIONS_CONFIRM}, {"nearbyShareActionsConfirm", IDS_NEARBY_ACTIONS_CONFIRM},
...@@ -104,6 +105,8 @@ void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) { ...@@ -104,6 +105,8 @@ void RegisterNearbySharedStrings(content::WebUIDataSource* data_source) {
{"nearbyShareHighVisibilityHelpText", {"nearbyShareHighVisibilityHelpText",
IDS_NEARBY_HIGH_VISIBILITY_HELP_TEXT}, IDS_NEARBY_HIGH_VISIBILITY_HELP_TEXT},
{"nearbyShareReceiveConfirmPageTitle", {"nearbyShareReceiveConfirmPageTitle",
IDS_NEARBY_RECEIVE_CONFIRM_PAGE_TITLE}}; IDS_NEARBY_RECEIVE_CONFIRM_PAGE_TITLE},
{"nearbyShareReceiveConfirmPageConnectionId",
IDS_NEARBY_RECEIVE_CONFIRM_PAGE_CONNECTION_ID}};
webui::AddLocalizedStringsBulk(data_source, kLocalizedStrings); webui::AddLocalizedStringsBulk(data_source, kLocalizedStrings);
} }
...@@ -94,8 +94,8 @@ suite('NearbyShare', function() { ...@@ -94,8 +94,8 @@ suite('NearbyShare', function() {
assertEquals( assertEquals(
target.name, confirmPage.$$('#shareTargetName').textContent.trim()); target.name, confirmPage.$$('#shareTargetName').textContent.trim());
assertEquals( assertTrue(
'1234', confirmPage.$$('#connectionToken').textContent.trim()); confirmPage.$$('#connectionToken').textContent.includes('1234'));
confirmPage.$$('nearby-page-template').$$('#actionButton').click(); confirmPage.$$('nearby-page-template').$$('#actionButton').click();
const shareTargetId = await fakeReceiveManager.whenCalled('accept'); const shareTargetId = await fakeReceiveManager.whenCalled('accept');
...@@ -114,8 +114,8 @@ suite('NearbyShare', function() { ...@@ -114,8 +114,8 @@ suite('NearbyShare', function() {
assertEquals( assertEquals(
target.name, confirmPage.$$('#shareTargetName').textContent.trim()); target.name, confirmPage.$$('#shareTargetName').textContent.trim());
assertEquals( assertTrue(
'1234', confirmPage.$$('#connectionToken').textContent.trim()); confirmPage.$$('#connectionToken').textContent.includes('1234'));
confirmPage.$$('nearby-page-template').$$('#cancelButton').click(); confirmPage.$$('nearby-page-template').$$('#cancelButton').click();
const shareTargetId = await fakeReceiveManager.whenCalled('reject'); const shareTargetId = await fakeReceiveManager.whenCalled('reject');
......
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