[Quick Share v2] Add IDS strings and correct icon to quick settings tile
Title. Also allow Your devices, Contacts, Hidden visibility rows to be tabbed between and toggled via keyboard. Tested: verified manually. Bug: 323206955 Change-Id: I6f72833c4e4967797c88ce05cf2e6ce60e79e747 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6112299 Commit-Queue: Brando Socarras <brandosocarras@google.com> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Cr-Commit-Position: refs/heads/main@{#1403348}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
15d67d28aa
commit
6ccf949b04
ash
BUILD.gnash_strings.grd
ash_strings_grd
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_CONTACTS_SUBLABEL.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_LABEL.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_SUBLABEL.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_HIDDEN_SUBLABEL.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_YOUR_DEVICES_SUBLABEL.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_CONTACTS.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_HIDDEN.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_ON.png.sha1IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_YOUR_DEVICES.png.sha1
resources
vector_icons
system
@ -3292,6 +3292,7 @@ component("ash") {
|
||||
"//ash/public/cpp",
|
||||
"//ash/public/cpp/app_list/vector_icons:vector_icons",
|
||||
"//ash/public/cpp/resources:ash_public_unscaled_resources",
|
||||
"//ash/quick_pair/common:common",
|
||||
"//ash/resources/vector_icons",
|
||||
"//ash/strings",
|
||||
"//chromeos/ash/components/osauth/impl",
|
||||
|
@ -452,8 +452,38 @@ Style notes:
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_BUTTON_LABEL" desc="The shorter label used for the button in the status tray to toggle Nearby Share high visibility mode, which makes the device visible to all nearby devices for file sharing.">
|
||||
Nearby visibility
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_CONTACTS_SUBLABEL" desc="The sublabel in the Contacts visibility row.">
|
||||
Only your contacts with a Google Account
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_LABEL" desc="The label in the Everyone visibility toggle row.">
|
||||
Visible to everyone
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_SUBLABEL" desc="The sublabel in the Everyone visibility toggle row.">
|
||||
For 10 min
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_HIDDEN_SUBLABEL" desc="The sublabel in the Hidden visibility row.">
|
||||
No one can share with you
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_YOUR_DEVICES_SUBLABEL" desc="The sublabel in the Your devices visibility row.">
|
||||
Only devices signed into <ph name="EMAIL">$1<ex>test@gmail.com</ex></ph>
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL" desc="The shorter label used for the feature tile in the status tray to toggle Nearby Share high visibility mode, which makes the device visible to all nearby devices for file sharing.">
|
||||
Nearby Share
|
||||
Quick Share
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_CONTACTS" desc="Quick Share quick settings tile label indicates device is in Contacts visibility.">
|
||||
Contacts
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_HIDDEN" desc="Quick Share quick settings tile label indicates device is in Hidden visibility.">
|
||||
Hidden
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF" desc="Quick Share quick settings tile label indicates Quick Share is disabled.">
|
||||
Off
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_ON" desc="Quick Share quick settings tile label indicates Quick Share is enabled.">
|
||||
On
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_YOUR_DEVICES" desc="Quick Share quick settings tile sublabel indicates device is in Your devices visibility.">
|
||||
Your devices
|
||||
</message>
|
||||
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_PH" desc="Feature name placeholder: The shorter label used for the feature tile in the status tray to toggle Nearby Share high visibility mode, which makes the device visible to all nearby devices for file sharing.">
|
||||
<ph name="FEATURE_NAME">$1<ex>Nearby Share</ex></ph>
|
||||
|
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_CONTACTS_SUBLABEL.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_CONTACTS_SUBLABEL.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
d67312655180e9406ea0279554b795e04ca1bca3
|
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_LABEL.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_LABEL.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
d67312655180e9406ea0279554b795e04ca1bca3
|
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_SUBLABEL.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_SUBLABEL.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
d67312655180e9406ea0279554b795e04ca1bca3
|
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_HIDDEN_SUBLABEL.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_HIDDEN_SUBLABEL.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
d67312655180e9406ea0279554b795e04ca1bca3
|
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_YOUR_DEVICES_SUBLABEL.png.sha1
Normal file
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_YOUR_DEVICES_SUBLABEL.png.sha1
Normal file
@ -0,0 +1 @@
|
||||
d67312655180e9406ea0279554b795e04ca1bca3
|
@ -1 +1 @@
|
||||
7b5be464228da5f62bcf2df39c75a3261521bfaa
|
||||
1f1a08c98faf75396633f0bd4745638e8e1e13ab
|
@ -0,0 +1 @@
|
||||
49c779c649a9972f419276d75e8a9840d5c8ad2f
|
@ -0,0 +1 @@
|
||||
2dbd4f14c9433bfefa86e27d81626888a7a5c2e6
|
@ -0,0 +1 @@
|
||||
c4ad190d21da8bd6ff3df4fbc4d5c89a5cd13107
|
@ -0,0 +1 @@
|
||||
d67312655180e9406ea0279554b795e04ca1bca3
|
@ -0,0 +1 @@
|
||||
1f1a08c98faf75396633f0bd4745638e8e1e13ab
|
@ -4,61 +4,61 @@
|
||||
|
||||
CANVAS_DIMENSIONS, 20,
|
||||
FILL_RULE_NONZERO,
|
||||
MOVE_TO, 14.1f, 11.3f,
|
||||
LINE_TO, 12.65f, 9.85f,
|
||||
CUBIC_TO, 12.8f, 9.07f, 12.58f, 8.33f, 11.98f, 7.65f,
|
||||
CUBIC_TO, 11.38f, 6.97f, 10.6f, 6.7f, 9.65f, 6.85f,
|
||||
LINE_TO, 8.2f, 5.4f,
|
||||
CUBIC_TO, 8.48f, 5.27f, 8.77f, 5.17f, 9.05f, 5.1f,
|
||||
CUBIC_TO, 9.35f, 5.03f, 9.67f, 5, 10, 5,
|
||||
CUBIC_TO, 11.25f, 5, 12.31f, 5.44f, 13.18f, 6.33f,
|
||||
CUBIC_TO, 14.06f, 7.19f, 14.5f, 8.25f, 14.5f, 9.5f,
|
||||
CUBIC_TO, 14.5f, 9.83f, 14.47f, 10.15f, 14.4f, 10.45f,
|
||||
CUBIC_TO, 14.33f, 10.73f, 14.23f, 11.02f, 14.1f, 11.3f,
|
||||
MOVE_TO, 13.29f, 11.06f,
|
||||
LINE_TO, 11.79f, 9.56f,
|
||||
CUBIC_TO, 11.82f, 9.15f, 11.69f, 8.8f, 11.4f, 8.52f,
|
||||
CUBIC_TO, 11.12f, 8.24f, 10.78f, 8.12f, 10.4f, 8.15f,
|
||||
LINE_TO, 8.94f, 6.69f,
|
||||
CUBIC_TO, 9.1f, 6.62f, 9.28f, 6.57f, 9.46f, 6.54f,
|
||||
CUBIC_TO, 9.65f, 6.51f, 9.83f, 6.5f, 10, 6.5f,
|
||||
CUBIC_TO, 10.97f, 6.5f, 11.8f, 6.84f, 12.48f, 7.52f,
|
||||
CUBIC_TO, 13.16f, 8.2f, 13.5f, 9.03f, 13.5f, 10,
|
||||
CUBIC_TO, 13.5f, 10.17f, 13.49f, 10.35f, 13.46f, 10.54f,
|
||||
CUBIC_TO, 13.43f, 10.72f, 13.38f, 10.9f, 13.29f, 11.06f,
|
||||
CLOSE,
|
||||
MOVE_TO, 17.3f, 14.45f,
|
||||
LINE_TO, 15.85f, 13.05f,
|
||||
CUBIC_TO, 16.48f, 12.57f, 17.04f, 12.04f, 17.52f, 11.48f,
|
||||
CUBIC_TO, 18.02f, 10.89f, 18.45f, 10.23f, 18.8f, 9.5f,
|
||||
CUBIC_TO, 17.97f, 7.82f, 16.77f, 6.48f, 15.2f, 5.5f,
|
||||
CUBIC_TO, 13.65f, 4.5f, 11.92f, 4, 10, 4,
|
||||
CUBIC_TO, 9.52f, 4, 9.04f, 4.03f, 8.57f, 4.1f,
|
||||
CUBIC_TO, 8.11f, 4.17f, 7.65f, 4.27f, 7.2f, 4.4f,
|
||||
LINE_TO, 5.65f, 2.85f,
|
||||
CUBIC_TO, 6.33f, 2.57f, 7.03f, 2.36f, 7.75f, 2.23f,
|
||||
CUBIC_TO, 8.47f, 2.08f, 9.22f, 2, 10, 2,
|
||||
CUBIC_TO, 12.52f, 2, 14.76f, 2.7f, 16.73f, 4.1f,
|
||||
CUBIC_TO, 18.69f, 5.48f, 20.12f, 7.28f, 21, 9.5f,
|
||||
CUBIC_TO, 20.62f, 10.48f, 20.11f, 11.4f, 19.48f, 12.25f,
|
||||
CUBIC_TO, 18.86f, 13.08f, 18.13f, 13.82f, 17.3f, 14.45f,
|
||||
MOVE_TO, 16.21f, 13.98f,
|
||||
LINE_TO, 15.02f, 12.77f,
|
||||
CUBIC_TO, 15.49f, 12.4f, 15.92f, 11.99f, 16.31f, 11.54f,
|
||||
CUBIC_TO, 16.72f, 11.08f, 17.06f, 10.57f, 17.35f, 10,
|
||||
CUBIC_TO, 16.66f, 8.6f, 15.65f, 7.5f, 14.33f, 6.71f,
|
||||
CUBIC_TO, 13.01f, 5.9f, 11.57f, 5.5f, 10, 5.5f,
|
||||
CUBIC_TO, 9.64f, 5.5f, 9.29f, 5.52f, 8.96f, 5.56f,
|
||||
CUBIC_TO, 8.64f, 5.6f, 8.32f, 5.67f, 8, 5.75f,
|
||||
LINE_TO, 6.67f, 4.42f,
|
||||
CUBIC_TO, 7.19f, 4.21f, 7.74f, 4.06f, 8.29f, 3.98f,
|
||||
CUBIC_TO, 8.86f, 3.9f, 9.43f, 3.85f, 10, 3.85f,
|
||||
CUBIC_TO, 12, 3.85f, 13.84f, 4.4f, 15.52f, 5.5f,
|
||||
CUBIC_TO, 17.2f, 6.58f, 18.41f, 8.08f, 19.15f, 10,
|
||||
CUBIC_TO, 18.84f, 10.79f, 18.43f, 11.52f, 17.92f, 12.19f,
|
||||
CUBIC_TO, 17.4f, 12.84f, 16.83f, 13.44f, 16.21f, 13.98f,
|
||||
CLOSE,
|
||||
MOVE_TO, 17.8f, 20.6f,
|
||||
LINE_TO, 13.6f, 16.45f,
|
||||
CUBIC_TO, 13.02f, 16.63f, 12.43f, 16.77f, 11.83f, 16.88f,
|
||||
CUBIC_TO, 11.24f, 16.96f, 10.63f, 17, 10, 17,
|
||||
CUBIC_TO, 7.48f, 17, 5.24f, 16.31f, 3.28f, 14.93f,
|
||||
CUBIC_TO, 1.31f, 13.53f, -0.12f, 11.72f, -1, 9.5f,
|
||||
CUBIC_TO, -0.65f, 8.62f, -0.21f, 7.8f, 0.33f, 7.05f,
|
||||
CUBIC_TO, 0.86f, 6.28f, 1.47f, 5.6f, 2.15f, 5,
|
||||
LINE_TO, -0.6f, 2.2f,
|
||||
LINE_TO, 0.8f, 0.8f,
|
||||
LINE_TO, 19.2f, 19.2f,
|
||||
LINE_TO, 17.8f, 20.6f,
|
||||
MOVE_TO, 15.94f, 18.19f,
|
||||
LINE_TO, 13.31f, 15.56f,
|
||||
CUBIC_TO, 12.8f, 15.76f, 12.26f, 15.9f, 11.71f, 16,
|
||||
CUBIC_TO, 11.15f, 16.1f, 10.58f, 16.15f, 10, 16.15f,
|
||||
CUBIC_TO, 7.99f, 16.15f, 6.14f, 15.6f, 4.46f, 14.52f,
|
||||
CUBIC_TO, 2.79f, 13.42f, 1.59f, 11.92f, 0.85f, 10,
|
||||
CUBIC_TO, 1.15f, 9.21f, 1.54f, 8.49f, 2.04f, 7.83f,
|
||||
CUBIC_TO, 2.56f, 7.17f, 3.14f, 6.56f, 3.79f, 6.02f,
|
||||
LINE_TO, 1.73f, 3.96f,
|
||||
LINE_TO, 2.85f, 2.85f,
|
||||
LINE_TO, 17.06f, 17.06f,
|
||||
LINE_TO, 15.94f, 18.19f,
|
||||
CLOSE,
|
||||
MOVE_TO, 3.55f, 6.4f,
|
||||
CUBIC_TO, 3.07f, 6.83f, 2.63f, 7.31f, 2.23f, 7.83f,
|
||||
CUBIC_TO, 1.83f, 8.34f, 1.48f, 8.9f, 1.2f, 9.5f,
|
||||
CUBIC_TO, 2.03f, 11.18f, 3.23f, 12.53f, 4.78f, 13.53f,
|
||||
CUBIC_TO, 6.34f, 14.51f, 8.08f, 15, 10, 15,
|
||||
CUBIC_TO, 10.33f, 15, 10.66f, 14.98f, 10.98f, 14.95f,
|
||||
CUBIC_TO, 11.29f, 14.9f, 11.62f, 14.85f, 11.95f, 14.8f,
|
||||
LINE_TO, 11.05f, 13.85f,
|
||||
CUBIC_TO, 10.87f, 13.9f, 10.69f, 13.94f, 10.53f, 13.98f,
|
||||
CUBIC_TO, 10.36f, 13.99f, 10.18f, 14, 10, 14,
|
||||
CUBIC_TO, 8.75f, 14, 7.68f, 13.57f, 6.8f, 12.7f,
|
||||
CUBIC_TO, 5.93f, 11.82f, 5.5f, 10.75f, 5.5f, 9.5f,
|
||||
CUBIC_TO, 5.5f, 9.32f, 5.51f, 9.14f, 5.53f, 8.98f,
|
||||
CUBIC_TO, 5.56f, 8.81f, 5.6f, 8.63f, 5.65f, 8.45f,
|
||||
LINE_TO, 3.55f, 6.4f,
|
||||
MOVE_TO, 4.98f, 7.21f,
|
||||
CUBIC_TO, 4.49f, 7.6f, 4.05f, 8.01f, 3.65f, 8.46f,
|
||||
CUBIC_TO, 3.26f, 8.9f, 2.93f, 9.42f, 2.67f, 10,
|
||||
CUBIC_TO, 3.35f, 11.4f, 4.35f, 12.51f, 5.67f, 13.31f,
|
||||
CUBIC_TO, 6.99f, 14.1f, 8.43f, 14.5f, 10, 14.5f,
|
||||
CUBIC_TO, 10.33f, 14.5f, 10.67f, 14.48f, 11, 14.44f,
|
||||
CUBIC_TO, 11.33f, 14.4f, 11.67f, 14.33f, 12.02f, 14.25f,
|
||||
LINE_TO, 11.08f, 13.31f,
|
||||
CUBIC_TO, 10.9f, 13.37f, 10.72f, 13.42f, 10.54f, 13.46f,
|
||||
CUBIC_TO, 10.36f, 13.49f, 10.18f, 13.5f, 10, 13.5f,
|
||||
CUBIC_TO, 9.03f, 13.5f, 8.2f, 13.16f, 7.52f, 12.48f,
|
||||
CUBIC_TO, 6.84f, 11.8f, 6.5f, 10.97f, 6.5f, 10,
|
||||
CUBIC_TO, 6.5f, 9.82f, 6.52f, 9.64f, 6.56f, 9.46f,
|
||||
CUBIC_TO, 6.6f, 9.28f, 6.65f, 9.1f, 6.69f, 8.92f,
|
||||
LINE_TO, 4.98f, 7.21f,
|
||||
CLOSE,
|
||||
NEW_PATH
|
@ -7,6 +7,7 @@ include_rules = [
|
||||
"+components/global_media_controls",
|
||||
"+components/live_caption",
|
||||
"+components/prefs",
|
||||
"+components/signin/public/identity_manager/identity_manager.h",
|
||||
"+grit/ui_chromeos_resources.h",
|
||||
"+google_apis/common",
|
||||
]
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "ash/public/cpp/nearby_share_delegate.h"
|
||||
#include "ash/public/cpp/system_tray_client.h"
|
||||
#include "ash/quick_pair/common/quick_pair_browser_delegate.h"
|
||||
#include "ash/resources/vector_icons/vector_icons.h"
|
||||
#include "ash/shell.h"
|
||||
#include "ash/strings/grit/ash_strings.h"
|
||||
@ -20,6 +21,8 @@
|
||||
#include "ash/system/tray/tri_view.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "components/signin/public/identity_manager/identity_manager.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/base/models/image_model.h"
|
||||
#include "ui/chromeos/styles/cros_tokens_color_mappings.h"
|
||||
@ -54,6 +57,64 @@ void FormatVisibilityRow(ash::HoverHighlightView* visibility_row,
|
||||
visibility_row->SetRightViewVisible(false);
|
||||
visibility_row->SetEnabled(is_row_enabled);
|
||||
}
|
||||
|
||||
std::u16string GetUserEmail() {
|
||||
auto* quick_pair_browser_delegate =
|
||||
ash::quick_pair::QuickPairBrowserDelegate::Get();
|
||||
if (!quick_pair_browser_delegate) {
|
||||
return std::u16string();
|
||||
}
|
||||
signin::IdentityManager* identity_manager =
|
||||
quick_pair_browser_delegate->GetIdentityManager();
|
||||
if (!identity_manager) {
|
||||
return std::u16string();
|
||||
}
|
||||
|
||||
return base::ASCIIToUTF16(
|
||||
identity_manager->GetPrimaryAccountInfo(signin::ConsentLevel::kSignin)
|
||||
.email);
|
||||
}
|
||||
|
||||
std::u16string GetYourDevicesLabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_YOUR_DEVICES);
|
||||
}
|
||||
|
||||
std::u16string GetContactsLabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_CONTACTS);
|
||||
}
|
||||
|
||||
std::u16string GetHiddenLabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_HIDDEN);
|
||||
}
|
||||
|
||||
std::u16string GetEveryoneLabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_LABEL);
|
||||
}
|
||||
|
||||
std::u16string GetYourDevicesSublabel(std::u16string user_email) {
|
||||
return l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_YOUR_DEVICES_SUBLABEL,
|
||||
user_email);
|
||||
}
|
||||
|
||||
std::u16string GetContactsSublabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_CONTACTS_SUBLABEL);
|
||||
}
|
||||
|
||||
std::u16string GetHiddenSublabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_HIDDEN_SUBLABEL);
|
||||
}
|
||||
|
||||
std::u16string GetEveryoneSublabel() {
|
||||
return l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_EVERYONE_SUBLABEL);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace ash {
|
||||
@ -61,8 +122,8 @@ namespace ash {
|
||||
NearbyShareDetailedViewImpl::NearbyShareDetailedViewImpl(
|
||||
DetailedViewDelegate* detailed_view_delegate)
|
||||
: TrayDetailedView(detailed_view_delegate),
|
||||
user_email_(GetUserEmail()),
|
||||
nearby_share_delegate_(Shell::Get()->nearby_share_delegate()) {
|
||||
// TODO(brandosocarras, b/360150790): Create and use a Quick Share string.
|
||||
CreateTitleRow(IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL);
|
||||
CreateScrollableList();
|
||||
CreateIsEnabledContainer();
|
||||
@ -126,7 +187,12 @@ void NearbyShareDetailedViewImpl::CreateIsEnabledContainer() {
|
||||
|
||||
// TODO(brandosocarras, b/360150790): Create and use 'On'/'Off' strings.
|
||||
const bool is_qs_enabled = nearby_share_delegate_->IsEnabled();
|
||||
toggle_row_->AddLabelRow(is_qs_enabled ? u"On" : u"Off", /*start_inset=*/0);
|
||||
toggle_row_->AddLabelRow(
|
||||
is_qs_enabled ? l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_ON)
|
||||
: l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF),
|
||||
/*start_inset=*/0);
|
||||
toggle_row_->text_label()->SetEnabledColorId(cros_tokens::kCrosSysOnSurface);
|
||||
TypographyProvider::Get()->StyleLabel(ash::TypographyToken::kCrosButton1,
|
||||
*toggle_row_->text_label());
|
||||
@ -172,13 +238,10 @@ void NearbyShareDetailedViewImpl::CreateYourDevicesRow() {
|
||||
|
||||
your_devices_row_ = visibility_selection_container_->AddChildView(
|
||||
std::make_unique<HoverHighlightView>(/*listener=*/this));
|
||||
// TODO(brandosocarras, b/360150790): replace label, sublabel with IDS
|
||||
// strings.
|
||||
CreateVisibilityRow(your_devices_row_,
|
||||
kQuickSettingsQuickShareYourDevicesIcon,
|
||||
/*label=*/u"Your devices",
|
||||
/*sublabel=*/u"Only devices signed into test@gmail.com");
|
||||
your_devices_row_->SetFocusBehavior(FocusBehavior::NEVER);
|
||||
/*label=*/GetYourDevicesLabel(),
|
||||
/*sublabel=*/GetYourDevicesSublabel(user_email_));
|
||||
}
|
||||
|
||||
void NearbyShareDetailedViewImpl::CreateContactsRow() {
|
||||
@ -187,12 +250,9 @@ void NearbyShareDetailedViewImpl::CreateContactsRow() {
|
||||
|
||||
contacts_row_ = visibility_selection_container_->AddChildView(
|
||||
std::make_unique<HoverHighlightView>(/*listener=*/this));
|
||||
// TODO(brandosocarras, b/360150790): replace label, sublabel with IDS
|
||||
// strings.
|
||||
CreateVisibilityRow(contacts_row_, kQuickSettingsQuickShareContactsIcon,
|
||||
/*label=*/u"Contacts",
|
||||
/*sublabel=*/u"Only your contacts with a Google Account");
|
||||
contacts_row_->SetFocusBehavior(FocusBehavior::NEVER);
|
||||
/*label=*/GetContactsLabel(),
|
||||
/*sublabel=*/GetContactsSublabel());
|
||||
}
|
||||
|
||||
void NearbyShareDetailedViewImpl::CreateHiddenRow() {
|
||||
@ -201,12 +261,9 @@ void NearbyShareDetailedViewImpl::CreateHiddenRow() {
|
||||
|
||||
hidden_row_ = visibility_selection_container_->AddChildView(
|
||||
std::make_unique<HoverHighlightView>(/*listener=*/this));
|
||||
// TODO(brandosocarras, b/360150790): replace label, sublabel with IDS
|
||||
// strings.
|
||||
CreateVisibilityRow(hidden_row_, kQuickSettingsQuickShareHiddenIcon,
|
||||
/*label=*/u"Hidden",
|
||||
/*sublabel=*/u"No one can share with you");
|
||||
hidden_row_->SetFocusBehavior(FocusBehavior::NEVER);
|
||||
/*label=*/GetHiddenLabel(),
|
||||
/*sublabel=*/GetHiddenSublabel());
|
||||
}
|
||||
|
||||
void NearbyShareDetailedViewImpl::CreateVisibilityRow(
|
||||
@ -243,13 +300,12 @@ void NearbyShareDetailedViewImpl::FormatEveryoneRow(
|
||||
const bool is_row_enabled) {
|
||||
everyone_toggle_ = nullptr;
|
||||
everyone_row_->Reset();
|
||||
// TODO(brandosocarras, b/360150790): Use IDS strings for label and sublabel.
|
||||
everyone_row_->AddIconAndLabel(
|
||||
ui::ImageModel::FromVectorIcon(kQuickSettingsQuickShareEveryoneIcon,
|
||||
/*color_id=*/color_id),
|
||||
u"Visible to everyone");
|
||||
GetEveryoneLabel());
|
||||
everyone_row_->text_label()->SetEnabledColorId(color_id);
|
||||
everyone_row_->SetSubText(u"You will be visible to everyone for 5 minutes.");
|
||||
everyone_row_->SetSubText(GetEveryoneSublabel());
|
||||
everyone_row_->sub_text_label()->SetEnabledColorId(color_id);
|
||||
auto toggle_switch = std::make_unique<Switch>(
|
||||
base::BindRepeating(&NearbyShareDetailedViewImpl::OnEveryoneToggleClicked,
|
||||
@ -280,18 +336,18 @@ void NearbyShareDetailedViewImpl::FormatVisibilitySelectionContainer(
|
||||
|
||||
FormatVisibilityRow(your_devices_row_,
|
||||
kQuickSettingsQuickShareYourDevicesIcon,
|
||||
/*label=*/u"Your devices",
|
||||
/*sublabel=*/u"Only devices signed into test@gmail.com",
|
||||
/*label=*/GetYourDevicesLabel(),
|
||||
/*sublabel=*/GetYourDevicesSublabel(user_email_),
|
||||
/*color_id=*/background_visibility_row_color,
|
||||
/*is_row_enabled=*/is_background_visibility_enabled);
|
||||
FormatVisibilityRow(contacts_row_, kQuickSettingsQuickShareContactsIcon,
|
||||
/*label=*/u"Contacts",
|
||||
/*sublabel=*/u"Only your contacts with a Google Account",
|
||||
/*label=*/GetContactsLabel(),
|
||||
/*sublabel=*/GetContactsSublabel(),
|
||||
/*color_id=*/background_visibility_row_color,
|
||||
/*is_row_enabled=*/is_background_visibility_enabled);
|
||||
FormatVisibilityRow(hidden_row_, kQuickSettingsQuickShareHiddenIcon,
|
||||
/*label=*/u"Hidden",
|
||||
/*sublabel=*/u"No one can share with you",
|
||||
/*label=*/GetHiddenLabel(),
|
||||
/*sublabel=*/GetHiddenSublabel(),
|
||||
/*color_id=*/background_visibility_row_color,
|
||||
/*is_row_enabled=*/is_background_visibility_enabled);
|
||||
FormatEveryoneRow(/*color_id=*/everyone_row_color, in_high_visibility,
|
||||
@ -314,8 +370,11 @@ void NearbyShareDetailedViewImpl::OnQuickShareToggleClicked() {
|
||||
}
|
||||
|
||||
const bool new_enabled_state = !nearby_share_delegate_->IsEnabled();
|
||||
// TODO(brandosocarras, b/360150790): Create and use 'On'/'Off' strings.
|
||||
toggle_row_->text_label()->SetText(new_enabled_state ? u"On" : u"Off");
|
||||
toggle_row_->text_label()->SetText(
|
||||
new_enabled_state ? l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_ON)
|
||||
: l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF));
|
||||
nearby_share_delegate_->SetEnabled(new_enabled_state);
|
||||
quick_share_toggle_->SetIsOn(new_enabled_state);
|
||||
FormatVisibilitySelectionContainer(/*in_high_visibility=*/false);
|
||||
|
@ -70,6 +70,8 @@ class ASH_EXPORT NearbyShareDetailedViewImpl : public NearbyShareDetailedView,
|
||||
|
||||
void SetCheckCircle(const bool in_high_visibility);
|
||||
|
||||
const std::u16string user_email_;
|
||||
|
||||
raw_ptr<views::Button> settings_button_ = nullptr;
|
||||
raw_ptr<RoundedContainer> is_enabled_container_ = nullptr;
|
||||
raw_ptr<HoverHighlightView> toggle_row_ = nullptr;
|
||||
|
@ -81,15 +81,6 @@ std::unique_ptr<FeatureTile> NearbyShareFeaturePodController::CreateTile(
|
||||
SessionControllerImpl* session_controller =
|
||||
Shell::Get()->session_controller();
|
||||
|
||||
const std::u16string feature_name =
|
||||
nearby_share_delegate_->GetPlaceholderFeatureName();
|
||||
tile_->SetLabel(
|
||||
feature_name.empty()
|
||||
? l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL)
|
||||
: l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_PH, feature_name));
|
||||
|
||||
if (chromeos::features::IsQuickShareV2Enabled()) {
|
||||
const bool target_visibility =
|
||||
nearby_share_delegate_->IsPodButtonVisible() &&
|
||||
@ -100,9 +91,7 @@ std::unique_ptr<FeatureTile> NearbyShareFeaturePodController::CreateTile(
|
||||
if (target_visibility) {
|
||||
TrackVisibilityUMA();
|
||||
}
|
||||
// TODO(brandosocarras, b/355325622):Indicate Quick Share visibility in
|
||||
// sublabel.
|
||||
tile_->SetSubLabel(
|
||||
tile_->SetLabel(
|
||||
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL));
|
||||
tile_->CreateDecorativeDrillInArrow();
|
||||
tile_->SetIconClickable(true);
|
||||
@ -123,6 +112,14 @@ std::unique_ptr<FeatureTile> NearbyShareFeaturePodController::CreateTile(
|
||||
if (target_visibility) {
|
||||
TrackVisibilityUMA();
|
||||
}
|
||||
const std::u16string feature_name =
|
||||
nearby_share_delegate_->GetPlaceholderFeatureName();
|
||||
tile_->SetLabel(feature_name.empty()
|
||||
? l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL)
|
||||
: l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_PH,
|
||||
feature_name));
|
||||
tile_->SetTooltipText(
|
||||
feature_name.empty()
|
||||
? l10n_util::GetStringUTF16(
|
||||
@ -169,6 +166,11 @@ void NearbyShareFeaturePodController::OnLabelPressed() {
|
||||
|
||||
void NearbyShareFeaturePodController::OnHighVisibilityEnabledChanged(
|
||||
bool enabled) {
|
||||
if (chromeos::features::IsQuickShareV2Enabled()) {
|
||||
enabled ? countdown_timer_.Reset() : countdown_timer_.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
shutoff_time_ = nearby_share_delegate_->HighVisibilityShutoffTime();
|
||||
countdown_timer_.Reset();
|
||||
@ -217,22 +219,59 @@ void NearbyShareFeaturePodController::UpdateQSv2Button() {
|
||||
}
|
||||
|
||||
void NearbyShareFeaturePodController::ToggleTileOn() {
|
||||
CHECK(nearby_share_delegate_);
|
||||
CHECK(tile_);
|
||||
|
||||
auto& on_icon = nearby_share_delegate_->GetIcon(/*on_icon=*/true);
|
||||
tile_->SetVectorIcon(on_icon.is_empty() ? kQuickSettingsNearbyShareOnIcon
|
||||
: on_icon);
|
||||
tile_->SetToggled(true);
|
||||
|
||||
if (nearby_share_delegate_->IsHighVisibilityOn()) {
|
||||
tile_->SetSubLabel(l10n_util::GetStringFUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_ON_STATE,
|
||||
RemainingTimeString(RemainingHighVisibilityTime())));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (nearby_share_delegate_->GetVisibility()) {
|
||||
case ::nearby_share::mojom::Visibility::kYourDevices:
|
||||
tile_->SetSubLabel(l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_YOUR_DEVICES));
|
||||
break;
|
||||
case ::nearby_share::mojom::Visibility::kAllContacts:
|
||||
tile_->SetSubLabel(l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_CONTACTS));
|
||||
break;
|
||||
case ::nearby_share::mojom::Visibility::kNoOne:
|
||||
tile_->SetSubLabel(l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_HIDDEN));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NearbyShareFeaturePodController::ToggleTileOff() {
|
||||
CHECK(nearby_share_delegate_);
|
||||
CHECK(tile_);
|
||||
auto& off_icon = nearby_share_delegate_->GetIcon(/*on_icon=*/false);
|
||||
tile_->SetVectorIcon(off_icon.is_empty() ? kQuickSettingsNearbyShareOffIcon
|
||||
: off_icon);
|
||||
tile_->SetToggled(false);
|
||||
tile_->SetSubLabel(l10n_util::GetStringUTF16(
|
||||
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF));
|
||||
}
|
||||
|
||||
base::TimeDelta NearbyShareFeaturePodController::RemainingHighVisibilityTime()
|
||||
const {
|
||||
base::TimeTicks now = base::TimeTicks::Now();
|
||||
if (chromeos::features::IsQuickShareV2Enabled()) {
|
||||
const base::TimeTicks shutoff_time =
|
||||
nearby_share_delegate_->HighVisibilityShutoffTime();
|
||||
return shutoff_time > now ? shutoff_time - now : base::Seconds(0);
|
||||
}
|
||||
|
||||
return shutoff_time_ > now ? shutoff_time_ - now : base::Seconds(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user