Commit a650553c authored by minch's avatar minch Committed by Commit Bot

dark_mode: Collapse button can be always enabled.

The chromevox navigation of collapse button has been improved at
crrev.com/c/2032508. The collapse button is actually always enabled now.
Remove the useless logic of it.

Bug: 1131543
Change-Id: I3cb398ec7aed15f9eebcb53c567540b7ee3ac586
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488385
Commit-Queue: Min Chen <minch@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819943}
parent 055f5c90
......@@ -16,7 +16,11 @@ namespace ash {
CollapseButton::CollapseButton(views::ButtonListener* listener)
: CustomShapeButton(listener) {
UpdateVectorIcon();
SetImage(views::Button::STATE_NORMAL,
gfx::CreateVectorIcon(
kUnifiedMenuExpandIcon,
AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary)));
}
CollapseButton::~CollapseButton() = default;
......@@ -58,14 +62,4 @@ const char* CollapseButton::GetClassName() const {
return "CollapseButton";
}
void CollapseButton::UpdateVectorIcon() {
const SkColor icon_color = AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary);
SetImage(views::Button::STATE_NORMAL,
gfx::CreateVectorIcon(
kUnifiedMenuExpandIcon,
GetEnabled() ? icon_color
: AshColorProvider::GetDisabledColor(icon_color)));
}
} // namespace ash
......@@ -6,7 +6,6 @@
#define ASH_SYSTEM_UNIFIED_COLLAPSE_BUTTON_H_
#include "ash/system/unified/custom_shape_button.h"
#include "base/bind.h"
namespace ash {
......@@ -29,16 +28,7 @@ class CollapseButton : public CustomShapeButton {
const char* GetClassName() const override;
private:
// Update the vector icon on initializing CollapseButton or when the |Enabled|
// property of CollapseButton changes. The vector icon will have different
// colors on the |Enabled| property.
void UpdateVectorIcon();
double expanded_amount_ = 1.0;
views::PropertyChangedSubscription enabled_changed_subscription_ =
AddEnabledChangedCallback(
base::BindRepeating(&CollapseButton::UpdateVectorIcon,
base::Unretained(this)));
DISALLOW_COPY_AND_ASSIGN(CollapseButton);
};
......
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