From 3b72df1f801b1a3b81bc226fc12705d827b511a2 Mon Sep 17 00:00:00 2001 From: Jason Thai Date: Tue, 15 Mar 2022 03:31:45 +0000 Subject: [PATCH] personalization: add zero state for ambient subpage When ambient mode is disabled, show zero state image and message. BUG=b/224550204 TEST=browser_tests --gtest_filter="PersonalizationAppComponentBrowserTest" Screenshot: https://screenshot.googleplex.com/6kcjM8aqpiMM22B Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome Change-Id: Ic1e2d8555056f8142a0d9b092bf4d6d7846626ad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3522727 Reviewed-by: Xiaohui Chen Commit-Queue: Jason Thai Cr-Commit-Position: refs/heads/main@{#980949} --- .../personalization_app_ui.cc | 2 + .../personalization_app/resources/BUILD.gn | 3 + .../common/ambient_mode_disabled.svg | 89 +++++++++++++++++++ .../common/ambient_mode_disabled_dark.svg | 85 ++++++++++++++++++ .../ambient/ambient_subpage_element.html | 46 ++++++---- .../trusted/ambient/zero_state_element.html | 27 ++++++ .../trusted/ambient/zero_state_element.ts | 48 ++++++++++ .../resources/trusted/personalization_app.ts | 1 + .../ambient_subpage_element_test.ts | 64 +++++++++---- chromeos/chromeos_strings.grd | 3 + ...P_AMBIENT_MODE_ZERO_STATE_MESSAGE.png.sha1 | 1 + 11 files changed, 335 insertions(+), 34 deletions(-) create mode 100644 ash/webui/personalization_app/resources/common/ambient_mode_disabled.svg create mode 100644 ash/webui/personalization_app/resources/common/ambient_mode_disabled_dark.svg create mode 100644 ash/webui/personalization_app/resources/trusted/ambient/zero_state_element.html create mode 100644 ash/webui/personalization_app/resources/trusted/ambient/zero_state_element.ts create mode 100644 chromeos/chromeos_strings_grd/IDS_PERSONALIZATION_APP_AMBIENT_MODE_ZERO_STATE_MESSAGE.png.sha1 diff --git a/ash/webui/personalization_app/personalization_app_ui.cc b/ash/webui/personalization_app/personalization_app_ui.cc index b3916598f82e8f..373654ad55ffc5 100644 --- a/ash/webui/personalization_app/personalization_app_ui.cc +++ b/ash/webui/personalization_app/personalization_app_ui.cc @@ -145,6 +145,8 @@ void AddStrings(content::WebUIDataSource* source) { IDS_PERSONALIZATION_APP_AMBIENT_MODE_ANIMATION_FEEL_THE_BREEZE_LABEL}, {"ambientModeAnimationFloatOnByLabel", IDS_PERSONALIZATION_APP_AMBIENT_MODE_ANIMATION_FLOAT_ON_BY_LABEL}, + {"ambientModeZeroStateMessage", + IDS_PERSONALIZATION_APP_AMBIENT_MODE_ZERO_STATE_MESSAGE}, // Google Photos strings {"googlePhotosLabel", IDS_PERSONALIZATION_APP_GOOGLE_PHOTOS}, diff --git a/ash/webui/personalization_app/resources/BUILD.gn b/ash/webui/personalization_app/resources/BUILD.gn index 983a925efb311f..2c6b072aead9b3 100644 --- a/ash/webui/personalization_app/resources/BUILD.gn +++ b/ash/webui/personalization_app/resources/BUILD.gn @@ -78,6 +78,7 @@ polymer_js_files = [ "trusted/ambient/toggle_row_element.ts", "trusted/ambient/topic_source_item_element.ts", "trusted/ambient/topic_source_list_element.ts", + "trusted/ambient/zero_state_element.ts", "trusted/personalization_main_element.ts", "trusted/personalization_router_element.ts", "trusted/personalization_theme_element.ts", @@ -110,6 +111,8 @@ polymer_js_files = [ static_resource_files = [ "icon_192.png", + "common/ambient_mode_disabled.svg", + "common/ambient_mode_disabled_dark.svg", "common/base.css", "common/feel_the_breeze.png", "common/float_on_by.png", diff --git a/ash/webui/personalization_app/resources/common/ambient_mode_disabled.svg b/ash/webui/personalization_app/resources/common/ambient_mode_disabled.svg new file mode 100644 index 00000000000000..e6819dea4ac518 --- /dev/null +++ b/ash/webui/personalization_app/resources/common/ambient_mode_disabled.svg @@ -0,0 +1,89 @@ + + + + + + + + + + 10:20 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ash/webui/personalization_app/resources/common/ambient_mode_disabled_dark.svg b/ash/webui/personalization_app/resources/common/ambient_mode_disabled_dark.svg new file mode 100644 index 00000000000000..b964466230a386 --- /dev/null +++ b/ash/webui/personalization_app/resources/common/ambient_mode_disabled_dark.svg @@ -0,0 +1,85 @@ + + + + + + + + 10:20 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html b/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html index 429a0179f255fd..a1cd79c86ba26f 100644 --- a/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html +++ b/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html @@ -6,6 +6,7 @@ display: grid; grid-template-areas: '. . toggles . .' + '. . zeroState . .' '. . spinner . .' '. . preview . .' '. . animation . .' @@ -18,6 +19,9 @@ grid-area: toggles; margin: 0 8px; } + ambient-zero-state { + grid-area: zeroState; + } paper-spinner-lite { grid-area: spinner; height: 28px; @@ -46,27 +50,31 @@ +