Skip to content

Commit

Permalink
CrOS Settings: Apps Google Play Store String Update
Browse files Browse the repository at this point in the history
Updating Apps > Google Play Store as part of OS Settings Revamp.
Design Doc: go/cros-settings-revamp-string-updates

Apps page: https://screenshot.googleplex.com/8vaippJkhf7vswP
Google Play page: https://screenshot.googleplex.com/BxE3Qh5E3NrcraX
Dialog when remove pressed: https://screenshot.googleplex.com/AJ6Cy7AmJfGB3dT

BUG=b/293200964,b/296909291
TEST=
Manual:Manually test that when the flag is on, the correct strings appear.

Automated: 
browsertest: OsSettingsAppsPageTest
Change-Id: I195f8756c3723bfacebfe2dc5007ec738547a80b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4799175
Reviewed-by: Wes Okuhara <wesokuhara@google.com>
Commit-Queue: Nikki Moteva <moteva@google.com>
Cr-Commit-Position: refs/heads/main@{#1188604}
  • Loading branch information
Moteva authored and Chromium LUCI CQ committed Aug 25, 2023
1 parent fbfc779 commit d682c46
Show file tree
Hide file tree
Showing 15 changed files with 197 additions and 25 deletions.
28 changes: 28 additions & 0 deletions chrome/app/os_settings_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -2290,6 +2290,9 @@ Press an assigned switch or key to remove assignment.
<message name="IDS_SETTINGS_GUEST_OS_SHARED_USB_DEVICES_LABEL" desc="Label for managing shared USB devices.">
Manage USB devices
</message>
<message name="IDS_SETTINGS_GUEST_OS_SHARED_USB_DEVICES_DESCRIPTION" desc="Description for managing shared USB devices.">
Let Android apps access USB devices on this Chromebook
</message>
<message name="IDS_SETTINGS_GUEST_OS_SHARED_USB_DEVICES_EXTRA_DESCRIPTION" desc="Extra description for managing shared USB devices.">
Only supported devices are shown.
</message>
Expand Down Expand Up @@ -2639,21 +2642,33 @@ Press an assigned switch or key to remove assignment.
<message name="IDS_SETTINGS_ANDROID_APPS_LABEL" desc="The text associated with the primary section setting.">
Google Play Store
</message>
<message name="IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_LABEL" desc="The text associated with the primary section setting.">
Manage Google Play preferences
</message>
<message name="IDS_SETTINGS_ANDROID_APPS_ENABLE_BUTTON_ROLE" desc="Role description of the button which starts the Google Play Store Terms of Service screen. Spoken aloud by screen readers when the Turn On button is focused">
Turn on Google Play Store
</message>
<message name="IDS_SETTINGS_ANDROID_APPS_MANAGE_APPS" desc="Label for launching Android apps settings.">
Manage Android preferences
</message>
<message name="IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_MANAGE_APPS" desc="Label for launching Android apps settings.">
Android Settings
</message>
<message name="IDS_SETTINGS_ANDROID_APPS_REMOVE" desc="Label for the control to open a dialog confirming removal of the Google Play Store.">
Remove Google Play Store
</message>
<message name="IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_REMOVE" desc="Label for the control to open a dialog confirming removal of the Google Play Store.">
Remove Google Play and Android apps
</message>
<message name="IDS_SETTINGS_ANDROID_APPS_REMOVE_BUTTON" desc="Label for the button for the removal of the Google Play Store">
Remove
</message>
<message name="IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_TITLE" desc="Title of the confirmation dialog for disabling android apps.">
Remove Android apps?
</message>
<message name="IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_DISABLE_DIALOG_TITLE" desc="Title of the confirmation dialog for disabling android apps.">
Remove Google Play and Android apps?
</message>
<message name="IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_REMOVE" desc="Label for confirmation button in the disable android apps dialog.">
Remove Android apps
</message>
Expand All @@ -2663,6 +2678,9 @@ Press an assigned switch or key to remove assignment.
<message name="IDS_SETTINGS_APPS_ARC_VM_SHARED_USB_DEVICES_DESCRIPTION" desc="Description for managing shared USB devices. Do not translate 'ARCVM'.">
Let Android apps access USB devices on this Chromebook. Permission will be requested each time you plug in a USB device. Individual Android apps will ask for additional permissions.
</message>
<message name="IDS_OS_SETTINGS_REVAMP_OPEN_GOOGLE_PLAY" desc="Label for launching Google Play Store.">
Open Google Play
</message>

<!-- Device Stylus (OS settings) -->
<message name="IDS_SETTINGS_STYLUS_TITLE" desc="Title of the stylus settings page.">
Expand Down Expand Up @@ -5582,6 +5600,9 @@ Press &amp; hold keyboard keys to see accent marks and special characters. This
<message name="IDS_SETTINGS_ANDROID_APPS_SUBTEXT" desc="Description for the section for enabling and managing Google Play Store (Android) apps.">
Install apps and games from Google Play on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>. <ph name="LINK_BEGIN">&lt;a target="_blank" href="$2<ex>https://google.com/</ex>"&gt;</ph>Learn more<ph name="LINK_END">&lt;/a&gt;</ph>
</message>
<message name="IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_SUBTEXT" desc="Description for the section for enabling and managing Google Play Store (Android) apps.">
You can download Android apps and games through the Play Store. <ph name="LINK_BEGIN">&lt;a target="_blank" href="$1<ex>https://google.com/</ex>"&gt;</ph>Learn more<ph name="LINK_END">&lt;/a&gt;</ph>
</message>
<!-- TODO(jamescook): Use device type instead of "Chromebook", which may
require changing ArcPlayTermsOfServiceConsent resource id handling. -->
<message name="IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_MESSAGE" desc="Describes what will happen if the user opts out of android apps.">
Expand All @@ -5591,6 +5612,13 @@ Press &amp; hold keyboard keys to see accent marks and special characters. This
<ph name="LINE_BREAKS2">&lt;br&gt;&lt;br&gt;</ph>
This doesn’t affect apps or content on other devices.
</message>
<message name="IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_DISABLE_DIALOG_MESSAGE" desc="Describes what will happen if the user opts out of android apps.">
Google Play and apps you've downloaded from Google Play will be deleted from this Chromebook.
<ph name="LINE_BREAKS1">&lt;br&gt;&lt;br&gt;</ph>
Content you've purchased through Google Play such as movies, TV shows, music, books, as well as purchases from other apps may also be deleted.
<ph name="LINE_BREAKS2">&lt;br&gt;&lt;br&gt;</ph>
This doesn't affect apps or content on other devices.
</message>
<message name="IDS_SETTINGS_APP_DETAILS_TITLE" desc="The title of app details subpage, which displays details about a specific app.">
App details
</message>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
44d0518645440fb251743ba02c502073d12f8ec6
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0c845f002381f7172d4acd0c2659cca0c0a4d9af
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c5178122e32341be3d88ef8d9a412417b8120bb9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aa635111d12891a1f3cf97b247b415165e7a9d27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2cef998a2d3e771f0fff2004e25461f32fe1b57e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bec0d8b395a09b7239aaabc878adff03c6fe2088
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3389c8a265a83409963168a21358d3692e7af025
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
09ed52c19702b018f8870f944657a90e2d734c76
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface AndroidAppsBrowserProxy {
* @param keyboardAction True if the app was opened using a keyboard action.
*/
showAndroidAppsSettings(keyboardAction: boolean): void;

openGooglePlayStore(url: string): void;
}

let instance: AndroidAppsBrowserProxy|null = null;
Expand All @@ -45,4 +47,8 @@ export class AndroidAppsBrowserProxyImpl implements AndroidAppsBrowserProxy {
showAndroidAppsSettings(keyboardAction: boolean): void {
chrome.send('showAndroidAppsSettings', [keyboardAction]);
}

openGooglePlayStore(url: string): void {
chrome.send('showPlayStoreApps', [url]);
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
<style include="settings-shared"></style>

<template is="dom-if" if="[[androidAppsInfo.settingsAppAvailable]]" restamp>
<cr-link-row id="manageApps" label="$i18n{androidAppsManageApps}"
on-click="onManageAndroidAppsClick_"
external
deep-link-focus-id$="[[Setting.kManageAndroidPreferences]]">
<template is="dom-if" if="[[isRevampWayfindingEnabled_]]">
<cr-link-row id="openGooglePlayRow" label="$i18n{androidOpenGooglePlay}"
on-click="onOpenGooglePlayClick_"
external>
</cr-link-row>
<template is="dom-if" if="[[androidAppsInfo.settingsAppAvailable]]" restamp>
<cr-link-row id="manageApps" class="hr" label="$i18n{androidAppsManageApps}"
on-click="onManageAndroidAppsClick_"
external
deep-link-focus-id$="[[Setting.kManageAndroidPreferences]]">
</cr-link-row>
</template>
</template>

<template is="dom-if" if="[[!isRevampWayfindingEnabled_]]">
<template is="dom-if" if="[[androidAppsInfo.settingsAppAvailable]]" restamp>
<cr-link-row id="manageApps" label="$i18n{androidAppsManageApps}"
on-click="onManageAndroidAppsClick_"
external
deep-link-focus-id$="[[Setting.kManageAndroidPreferences]]">
</cr-link-row>
</template>
</template>

<template is="dom-if" if="[[isArcVmManageUsbAvailable]]">
<cr-link-row
class="hr"
label="$i18n{guestOsSharedUsbDevicesLabel}"
sub-label="[[getGuestOsSharedUsbDevicesSublabel_()]]"
id="manageArcvmShareUsbDevices"
on-click="onSharedUsbDevicesClick_"
role-description="$i18n{subpageArrowRoleDescription}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {focusWithoutInk} from 'chrome://resources/js/focus_without_ink.js';
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';

import {castExists} from '../assert_extras.js';
import {isRevampWayfindingEnabled} from '../common/load_time_booleans.js';
import {DeepLinkingMixin} from '../deep_linking_mixin.js';
import {Setting} from '../mojom-webui/setting.mojom-webui.js';
import {RouteObserverMixin} from '../route_observer_mixin.js';
Expand All @@ -33,6 +34,8 @@ interface SettingsAndroidAppsSubpageElement {
};
}

const GOOGLE_PLAY_STORE_URL = 'https://play.google.com/store/';

const SettingsAndroidAppsSubpageElementBase =
DeepLinkingMixin(RouteObserverMixin(PrefsMixin(I18nMixin(PolymerElement))));

Expand Down Expand Up @@ -80,13 +83,22 @@ class SettingsAndroidAppsSubpageElement extends
Setting.kRemovePlayStore,
]),
},

isRevampWayfindingEnabled_: {
type: Boolean,
value() {
return isRevampWayfindingEnabled();
},
readOnly: true,
},
};
}

androidAppsInfo: AndroidAppsInfo;
isArcVmManageUsbAvailable: boolean;
private dialogBody_: string;
private playStoreEnabled_: boolean;
private isRevampWayfindingEnabled_: boolean;

override currentRouteChanged(route: Route) {
// Does not apply to this page.
Expand Down Expand Up @@ -152,6 +164,17 @@ class SettingsAndroidAppsSubpageElement extends
Router.getInstance().navigateTo(
routes.ANDROID_APPS_DETAILS_ARC_VM_SHARED_USB_DEVICES);
}

private getGuestOsSharedUsbDevicesSublabel_(): string|null {
return this.isRevampWayfindingEnabled_ ?
this.i18n('guestOsSharedUsbDevicesDescription') :
null;
}

private onOpenGooglePlayClick_(): void {
AndroidAppsBrowserProxyImpl.getInstance().openGooglePlayStore(
GOOGLE_PLAY_STORE_URL);
}
}

declare global {
Expand Down
41 changes: 31 additions & 10 deletions chrome/browser/ui/webui/settings/ash/apps_section.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ void AddGuestOsStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_GUEST_OS_SHARED_PATHS_LIST_EMPTY_MESSAGE},
{"guestOsSharedUsbDevicesLabel",
IDS_SETTINGS_GUEST_OS_SHARED_USB_DEVICES_LABEL},
{"guestOsSharedUsbDevicesDescription",
IDS_SETTINGS_GUEST_OS_SHARED_USB_DEVICES_DESCRIPTION},
{"guestOsSharedUsbDevicesExtraDescription",
IDS_SETTINGS_GUEST_OS_SHARED_USB_DEVICES_EXTRA_DESCRIPTION},
{"guestOsSharedUsbDevicesListEmptyMessage",
Expand Down Expand Up @@ -576,22 +578,37 @@ void AppsSection::OnAppRegistered(const std::string& app_id,
}

void AppsSection::AddAndroidAppStrings(content::WebUIDataSource* html_source) {
static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"androidAppsPageLabel", IDS_SETTINGS_ANDROID_APPS_LABEL},
const bool kIsRevampEnabled =
ash::features::IsOsSettingsRevampWayfindingEnabled();

webui::LocalizedString kLocalizedStrings[] = {
{"androidAppsPageLabel", kIsRevampEnabled
? IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_LABEL
: IDS_SETTINGS_ANDROID_APPS_LABEL},
{"androidAppsEnable", IDS_SETTINGS_TURN_ON},
{"androidAppsManageApps", IDS_SETTINGS_ANDROID_APPS_MANAGE_APPS},
{"androidAppsRemove", IDS_SETTINGS_ANDROID_APPS_REMOVE},
{"androidAppsManageApps",
kIsRevampEnabled ? IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_MANAGE_APPS
: IDS_SETTINGS_ANDROID_APPS_MANAGE_APPS},
{"androidAppsRemove", kIsRevampEnabled
? IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_REMOVE
: IDS_SETTINGS_ANDROID_APPS_REMOVE},
{"androidAppsRemoveButton", IDS_SETTINGS_ANDROID_APPS_REMOVE_BUTTON},
{"androidAppsDisableDialogTitle",
IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_TITLE},
kIsRevampEnabled
? IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_DISABLE_DIALOG_TITLE
: IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_TITLE},
{"androidAppsDisableDialogMessage",
IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_MESSAGE},
kIsRevampEnabled
? IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_DISABLE_DIALOG_MESSAGE
: IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_MESSAGE},
{"androidAppsDisableDialogRemove",
IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_REMOVE},
kIsRevampEnabled ? IDS_SETTINGS_ANDROID_APPS_REMOVE_BUTTON
: IDS_SETTINGS_ANDROID_APPS_DISABLE_DIALOG_REMOVE},
{"arcvmSharedUsbDevicesDescription",
IDS_SETTINGS_APPS_ARC_VM_SHARED_USB_DEVICES_DESCRIPTION},
{"androidAppsEnableButtonRole",
IDS_SETTINGS_ANDROID_APPS_ENABLE_BUTTON_ROLE},
{"androidOpenGooglePlay", IDS_OS_SETTINGS_REVAMP_OPEN_GOOGLE_PLAY},
};
html_source->AddLocalizedStrings(kLocalizedStrings);
html_source->AddLocalizedString("androidAppsPageTitle",
Expand All @@ -600,9 +617,13 @@ void AppsSection::AddAndroidAppStrings(content::WebUIDataSource* html_source) {
: IDS_SETTINGS_ANDROID_SETTINGS_TITLE);
html_source->AddString(
"androidAppsSubtext",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_ANDROID_APPS_SUBTEXT, ui::GetChromeOSDeviceName(),
GetHelpUrlWithBoard(chrome::kAndroidAppsLearnMoreURL)));
kIsRevampEnabled
? l10n_util::GetStringFUTF16(
IDS_OS_SETTINGS_REVAMP_ANDROID_APPS_SUBTEXT,
GetHelpUrlWithBoard(chrome::kAndroidAppsLearnMoreURL))
: l10n_util::GetStringFUTF16(
IDS_SETTINGS_ANDROID_APPS_SUBTEXT, ui::GetChromeOSDeviceName(),
GetHelpUrlWithBoard(chrome::kAndroidAppsLearnMoreURL)));
}

void AppsSection::AddPluginVmLoadTimeData(
Expand Down

0 comments on commit d682c46

Please sign in to comment.