Commit 537ad8a2 authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Update Strings and Improve XR Consent Flow logic

Updates strings in keeping with UX guidance during WebXr launch review
in 79 and also improves string "buildability" by making the bulleted
list easier to concatenate at run time.


Fixed: 1019393,1017467
Change-Id: I75bcaa1e8d6f92fd113089521fe177f6d3e48c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895395
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarPiotr Bialecki <bialpio@chromium.org>
Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712186}
parent d38e4cd1
......@@ -83,18 +83,20 @@ public class VrConsentDialog
String dialogTitle = resources.getString(R.string.xr_consent_dialog_title,
UrlFormatter.formatUrlForSecurityDisplayOmitScheme(mUrl));
String dialogBody;
String dialogBody = resources.getString(R.string.xr_consent_dialog_description_default);
switch (mConsentLevel) {
case XrConsentPromptLevel.VR_FLOOR_PLAN:
dialogBody = resources.getString(R.string.xr_consent_dialog_description_floor_plan);
dialogBody += resources.getString(
R.string.xr_consent_dialog_description_physical_features)
+ resources.getString(R.string.xr_consent_dialog_description_floor_plan);
break;
case XrConsentPromptLevel.VR_FEATURES:
dialogBody = resources.getString(
dialogBody += resources.getString(
R.string.xr_consent_dialog_description_physical_features);
break;
case XrConsentPromptLevel.DEFAULT:
default:
dialogBody = resources.getString(R.string.xr_consent_dialog_description_default);
dialogBody = "";
break;
}
......@@ -105,7 +107,7 @@ public class VrConsentDialog
.with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, resources,
R.string.xr_consent_dialog_button_allow_and_enter_vr)
.with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, resources,
R.string.xr_consent_dialog_button_deny_vr)
R.string.cancel)
.with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, true)
.build();
mModalDialogManager = activity.getModalDialogManager();
......
......@@ -9,32 +9,20 @@ found in the LICENSE file.
<grit-part>
<!-- XR consent dialog. -->
<message name="IDS_XR_CONSENT_DIALOG_TITLE" desc="Title of the user consent dialog displayed before allowing a website to start a VR presentation">
Allow <ph name="DOMAIN">%s<ex>example.com</ex></ph> to enter VR?
Enter VR from <ph name="DOMAIN">%s<ex>example.com</ex></ph>?
</message>
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT" desc="Body of the user consent dialog displayed before allowing a website to start a VR presentation">
Make sure you trust this site before entering VR.
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT" desc="This is the header for a bulleted list of potential concerns that we want to ensure the user is aware of before entering VR. This header and the appended items of the bulleted list make up the body of the user consent dialog displayed before a website may start a VR presentation.">
While you're in VR, this site may be able to learn about:
</message>
<!-- NOTE for the below: It seems as though the leading whitespace from the
first line will be removed. However, leading whitespace on subsequent
lines isn't. This is aligned it's current way to ensure proper alignment
when displayed. -->
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_PHYSICAL_FEATURES" desc="Body of the user consent dialog displayed before allowing a website to start a VR presentation, when physical features may be exposed. The 'make sure you trust this site' line is intended to align with the 'while you are in VR' line, and as such no additional indentation is currently applied.">
While you are in VR, this site may be able to learn about:
- your physical features, such as height
Make sure you trust this site before entering VR.
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_PHYSICAL_FEATURES" desc="Item for the bulleted list of potential concerns in the consent dialog indicating that physical features may be exposed. Preceded with a newline and then two spaces to allow for being appended to the bulleted list at runtime.">
'''
- your physical features, such as height
</message>
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_FLOOR_PLAN" desc="Body of the user consent dialog displayed before allowing a website to start a VR presentation, when both physical features and room layout may be exposed. The 'make sure you trust this site' line is intended to align with the 'while you are in VR' line, and as such no additional indentation is currently applied.">
While you are in VR, this site may be able to learn about:
- your physical features, such as height
- the layout of your room
Make sure you trust this site before entering VR.
</message>
<message name="IDS_XR_CONSENT_DIALOG_BUTTON_DENY_VR" desc="Text on the button of a user consent dialog which denies a website from starting a VR presentation">
Don&#39;t allow
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_FLOOR_PLAN" desc="Item for the bulleted list of potential concerns in the consent dialog indicating that phyiscal features may be exposed. Preceded with a newline and then two spaces to allow for being appended to the bulleted list at runtime.">
'''
- the layout of your room
</message>
<message name="IDS_XR_CONSENT_DIALOG_BUTTON_ALLOW_AND_ENTER_VR" desc="Text on the button of a user consent dialog which allows a website to start a VR presentation">
Allow &amp; enter VR
Enter VR
</message>
</grit-part>
43a4f446a3d9e2cb7933038f4e2aaef04fe70bfb
\ No newline at end of file
260a6d63d0676961a5095e1e4640ca6eeeca4080
\ No newline at end of file
a7788f728904bd58ae493f8951a3b21e5aa66045
\ No newline at end of file
a3645ec49c52139e87dfe4546f81106ae4758378
\ No newline at end of file
50ba0989fa0b2ccbbc03ec92b714d5ebe47bbaab
\ No newline at end of file
097b4f4691849812b1373d6a1662615f7946fe7a
\ No newline at end of file
09e7b784ba7cc21927cf0805434425ff23bf8df4
\ No newline at end of file
8cb47ed5d5b6f9a417296d27786aa37385761182
\ No newline at end of file
996e5028ec2be91a48b919f4e5361944264b46df
\ No newline at end of file
e5af6dcbda415543160df6950bd986a50a48ae46
\ No newline at end of file
......@@ -9,32 +9,20 @@ found in the LICENSE file.
<grit-part>
<!-- XR consent dialog. -->
<message name="IDS_XR_CONSENT_DIALOG_TITLE" desc="Title of the user consent dialog displayed before allowing a website to start a VR presentation">
Allow <ph name="DOMAIN">$1<ex>example.com</ex></ph> to enter VR?
Enter VR from <ph name="DOMAIN">$1<ex>example.com</ex></ph>?
</message>
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT" desc="Body of the user consent dialog displayed before allowing a website to start a VR presentation">
Make sure you trust this site before entering VR.
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT" desc="This is the header for a bulleted list of potential concerns that we want to ensure the user is aware of before entering VR. This header and the appended items of the bulleted list make up the body of the user consent dialog displayed before a website may start a VR presentation.">
While you're in VR, this site may be able to learn about:
</message>
<!-- NOTE for the below: It seems as though the leading whitespace from the
first line will be removed. However, leading whitespace on subsequent
lines isn't. This is aligned it's current way to ensure proper alignment
when displayed. -->
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_PHYSICAL_FEATURES" desc="Body of the user consent dialog displayed before allowing a website to start a VR presentation, when physical features may be exposed. The 'make sure you trust this site' line is intended to align with the 'while you are in VR' line, and as such no additional indentation is currently applied.">
While you are in VR, this site may be able to learn about:
- your physical features, such as height
Make sure you trust this site before entering VR.
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_PHYSICAL_FEATURES" desc="Item for the bulleted list of potential concerns in the consent dialog indicating that physical features may be exposed. Preceded with a newline and then two spaces to allow for being appended to the bulleted list at runtime.">
'''
- your physical features, such as height
</message>
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_FLOOR_PLAN" desc="Body of the user consent dialog displayed before allowing a website to start a VR presentation, when both physical features and room layout may be exposed. The 'make sure you trust this site' line is intended to align with the 'while you are in VR' line, and as such no additional indentation is currently applied.">
While you are in VR, this site may be able to learn about:
- your physical features, such as height
- the layout of your room
Make sure you trust this site before entering VR.
</message>
<message name="IDS_XR_CONSENT_DIALOG_BUTTON_DENY_VR" desc="Text on the button of a user consent dialog which denies a website from starting a VR presentation">
Don&#39;t allow
<message name="IDS_XR_CONSENT_DIALOG_DESCRIPTION_FLOOR_PLAN" desc="Item for the bulleted list of potential concerns in the consent dialog indicating that phyiscal features may be exposed. Preceded with a newline and then two spaces to allow for being appended to the bulleted list at runtime.">
'''
- the layout of your room
</message>
<message name="IDS_XR_CONSENT_DIALOG_BUTTON_ALLOW_AND_ENTER_VR" desc="Text on the button of a user consent dialog which allows a website to start a VR presentation">
Allow &amp; enter VR
Enter VR
</message>
</grit-part>
3358510d4e773dfd94a988aa87d42c6b162f6311
\ No newline at end of file
a39ab5f7c790fdf648f0ec58067ecf21896da0e2
\ No newline at end of file
a226b9e2b296edb86e17685bc650ee9eb60c755b
\ No newline at end of file
b16f3cc5289add34e0bcdf3be410ba42f0d3ef3a
\ No newline at end of file
e6d8bdaf00353e40e2a7210ea0b4e75b6985b313
\ No newline at end of file
669ae5b68c3b5340a2a1323e4514e0212f323eb1
\ No newline at end of file
b187c7e1cbe99db2f62bf47bd0b4edc842612fb7
\ No newline at end of file
2af9728b6685a089ed52b30e7cef7c68bd060f5a
\ No newline at end of file
3ca99892b388f5a40946d0ece68479074c289f23
\ No newline at end of file
eb06afb67e8ac5a8b325bbd76efefc8591708e04
\ No newline at end of file
24fc61598a47f3b74fbe4f97beb27602e4ebf681
\ No newline at end of file
......@@ -38,21 +38,36 @@ base::string16 XrSessionRequestConsentDialogDelegate::GetTitle() {
}
base::string16 XrSessionRequestConsentDialogDelegate::GetDialogMessage() {
DCHECK_NE(consent_level_, XrConsentPromptLevel::kNone);
if (consent_level_ == XrConsentPromptLevel::kDefault) {
return base::string16();
}
base::string16 dialog =
l10n_util::GetStringUTF16(IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT);
switch (consent_level_) {
case XrConsentPromptLevel::kDefault:
return l10n_util::GetStringUTF16(
IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT);
case XrConsentPromptLevel::kVRFeatures:
return l10n_util::GetStringUTF16(
dialog += l10n_util::GetStringUTF16(
IDS_XR_CONSENT_DIALOG_DESCRIPTION_PHYSICAL_FEATURES);
break;
case XrConsentPromptLevel::kVRFloorPlan:
return l10n_util::GetStringUTF16(
IDS_XR_CONSENT_DIALOG_DESCRIPTION_FLOOR_PLAN);
dialog += l10n_util::GetStringUTF16(
IDS_XR_CONSENT_DIALOG_DESCRIPTION_PHYSICAL_FEATURES) +
l10n_util::GetStringUTF16(
IDS_XR_CONSENT_DIALOG_DESCRIPTION_FLOOR_PLAN);
break;
// kDefault and kNone should both be handled by earlier checks, but the
// compiler doesn't know that. These are listed here explicltly rather than
// a "default" clause to ensure that we get compiler errors if new enum
// values are added and not handled.
case XrConsentPromptLevel::kDefault:
case XrConsentPromptLevel::kNone:
NOTREACHED();
return l10n_util::GetStringUTF16(
IDS_XR_CONSENT_DIALOG_DESCRIPTION_DEFAULT);
return base::string16();
}
return dialog;
}
base::string16 XrSessionRequestConsentDialogDelegate::GetAcceptButtonTitle() {
......@@ -60,10 +75,6 @@ base::string16 XrSessionRequestConsentDialogDelegate::GetAcceptButtonTitle() {
IDS_XR_CONSENT_DIALOG_BUTTON_ALLOW_AND_ENTER_VR);
}
base::string16 XrSessionRequestConsentDialogDelegate::GetCancelButtonTitle() {
return l10n_util::GetStringUTF16(IDS_XR_CONSENT_DIALOG_BUTTON_DENY_VR);
}
void XrSessionRequestConsentDialogDelegate::OnAccepted() {
OnUserActionTaken(true);
metrics_helper_->LogUserAction(ConsentDialogAction::kUserAllowed);
......
......@@ -36,7 +36,6 @@ class XrSessionRequestConsentDialogDelegate
base::string16 GetTitle() override;
base::string16 GetDialogMessage() override;
base::string16 GetAcceptButtonTitle() override;
base::string16 GetCancelButtonTitle() override;
base::Optional<int> GetDefaultDialogButton() override;
base::Optional<int> GetInitiallyFocusedButton() override;
......
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