Commit d60a8e3b authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Commit Bot

Revert "[Bluetooth] Change Bluetooth subtext to gray"

This reverts commit eb59216d.

Reason for revert: After evaluation, staying with green is decided.
BUG=b:167556640

Original change's description:
> [Bluetooth] Change Bluetooth subtext to gray
>
> As per recommendation in Comment #30 of crbug.com/1114876.
>
> BUG=b:167556640
>
> Change-Id: I57bc4ff360d05d1d6a0b03f58d4f24e23492b858
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410746
> Reviewed-by: Tim Song <tengs@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
> Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#808073}

TBR=xiyuan@chromium.org,tengs@chromium.org,sonnysasaka@chromium.org,hansberry@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: b:167556640
Change-Id: I6dd86bf9e10c8c06bb2fec96561da7715d14ccee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2430105Reviewed-by: default avatarSonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811354}
parent ad2b36c1
...@@ -254,7 +254,7 @@ void BluetoothDetailedView::AppendSameTypeDevicesToScrollList( ...@@ -254,7 +254,7 @@ void BluetoothDetailedView::AppendSameTypeDevicesToScrollList(
SetupConnectingScrollListItem(container); SetupConnectingScrollListItem(container);
break; break;
case BluetoothDeviceInfo::ConnectionState::kConnected: case BluetoothDeviceInfo::ConnectionState::kConnected:
SetupNeutralColorConnectedScrollListItem( SetupConnectedScrollListItem(
container, device->battery_info container, device->battery_info
? base::make_optional<uint8_t>( ? base::make_optional<uint8_t>(
device->battery_info->battery_percentage) device->battery_info->battery_percentage)
......
...@@ -353,19 +353,10 @@ HoverHighlightView* TrayDetailedView::AddScrollListCheckableItem( ...@@ -353,19 +353,10 @@ HoverHighlightView* TrayDetailedView::AddScrollListCheckableItem(
} }
void TrayDetailedView::SetupConnectedScrollListItem(HoverHighlightView* view) { void TrayDetailedView::SetupConnectedScrollListItem(HoverHighlightView* view) {
DCHECK(view->is_populated()); SetupConnectedScrollListItem(view, base::nullopt /* battery_percentage */);
base::string16 status;
view->SetSubText(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTED));
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::CAPTION);
style.set_color_style(TrayPopupItemStyle::ColorStyle::CONNECTED);
style.SetupLabel(view->sub_text_label());
} }
void TrayDetailedView::SetupNeutralColorConnectedScrollListItem( void TrayDetailedView::SetupConnectedScrollListItem(
HoverHighlightView* view, HoverHighlightView* view,
base::Optional<uint8_t> battery_percentage) { base::Optional<uint8_t> battery_percentage) {
DCHECK(view->is_populated()); DCHECK(view->is_populated());
...@@ -382,14 +373,7 @@ void TrayDetailedView::SetupNeutralColorConnectedScrollListItem( ...@@ -382,14 +373,7 @@ void TrayDetailedView::SetupNeutralColorConnectedScrollListItem(
} }
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::CAPTION); TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::CAPTION);
// The subtext is used for the "Connected" status and also the battery style.set_color_style(TrayPopupItemStyle::ColorStyle::CONNECTED);
// indicator percentage value. Using fixed green color may give the impression
// that the battery is in good state even though the charge value is low. In
// the future the UI will be re-implemented using a battery icon and different
// colors depending on the charge value (b/167556800). For now, we use the
// neutral gray color for both the "Connected" text and the battery value to
// avoid this confusion.
style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE);
style.SetupLabel(view->sub_text_label()); style.SetupLabel(view->sub_text_label());
} }
......
...@@ -97,14 +97,9 @@ class ASH_EXPORT TrayDetailedView : public views::View, ...@@ -97,14 +97,9 @@ class ASH_EXPORT TrayDetailedView : public views::View,
void SetupConnectedScrollListItem(HoverHighlightView* view); void SetupConnectedScrollListItem(HoverHighlightView* view);
// Adds connected sub label with the device's battery percentage to the |view| // Adds connected sub label with the device's battery percentage to the |view|
// with appropriate style and updates accessibility label. Exclusively used // with appropriate style and updates accessibility label.
// for Bluetooth since its Connected state also contains the battery charge void SetupConnectedScrollListItem(HoverHighlightView* view,
// value and the color needs to be gray (neutral for all battery values). base::Optional<uint8_t> battery_percentage);
// TODO(b/167556800): Remove this Bluetooth-specific view once the battery
// indicator has been re-implemented as an icon with its separate color.
void SetupNeutralColorConnectedScrollListItem(
HoverHighlightView* view,
base::Optional<uint8_t> battery_percentage);
// Adds connecting sub label to the |view| with appropriate style and updates // Adds connecting sub label to the |view| with appropriate style and updates
// accessibility label. // accessibility label.
......
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