Commit 33913b40 authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

Update search box icon color.

Bug: 1110766
Change-Id: I832431d2c500080143bb2b470553764d7262097e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2417653
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarYulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808604}
parent a522a877
......@@ -83,4 +83,9 @@ SkColor AppListColorProviderImpl::GetPageSwitcherInkDropHighlightColor() const {
ripple_attributes.highlight_opacity * 255);
}
SkColor AppListColorProviderImpl::GetSearchBoxIconColor() const {
return ash_color_provider_->GetContentLayerColor(
AshColorProvider::ContentLayerType::kButtonIconColor);
}
} // namespace ash
......@@ -29,6 +29,7 @@ class AppListColorProviderImpl : public AppListColorProvider {
SkColor GetPageSwitcherButtonColor() const override;
SkColor GetPageSwitcherInkDropBaseColor() const override;
SkColor GetPageSwitcherInkDropHighlightColor() const override;
SkColor GetSearchBoxIconColor() const override;
private:
// Unowned.
......
......@@ -60,4 +60,8 @@ SkColor TestAppListColorProvider::GetPageSwitcherInkDropHighlightColor() const {
return SkColorSetA(SK_ColorBLACK, 0x0F);
}
SkColor TestAppListColorProvider::GetSearchBoxIconColor() const {
return gfx::kGoogleGrey200;
}
} // namespace ash
......@@ -29,6 +29,7 @@ class TestAppListColorProvider : public AppListColorProvider {
SkColor GetPageSwitcherButtonColor() const override;
SkColor GetPageSwitcherInkDropBaseColor() const override;
SkColor GetPageSwitcherInkDropHighlightColor() const override;
SkColor GetSearchBoxIconColor() const override;
};
} // namespace ash
......
......@@ -196,8 +196,9 @@ void SearchBoxView::UpdateSearchIcon() {
const gfx::VectorIcon& icon = search_model_->search_engine_is_google()
? google_icon
: kSearchEngineNotGoogleIcon;
SetSearchIconImage(
gfx::CreateVectorIcon(icon, search_box::kIconSize, search_box_color()));
SetSearchIconImage(gfx::CreateVectorIcon(
icon, search_box::kIconSize,
AppListColorProvider::Get()->GetSearchBoxIconColor()));
}
void SearchBoxView::UpdateSearchBoxBorder() {
......@@ -231,10 +232,10 @@ int SearchBoxView::GetFocusRingSpacing() {
void SearchBoxView::SetupCloseButton() {
views::ImageButton* close = close_button();
close->SetImage(
views::ImageButton::STATE_NORMAL,
gfx::CreateVectorIcon(views::kIcCloseIcon, search_box::kIconSize,
gfx::kGoogleGrey700));
close->SetImage(views::ImageButton::STATE_NORMAL,
gfx::CreateVectorIcon(
views::kIcCloseIcon, search_box::kIconSize,
AppListColorProvider::Get()->GetSearchBoxIconColor()));
close->SetVisible(false);
base::string16 close_button_label(
l10n_util::GetStringUTF16(IDS_APP_LIST_CLEAR_SEARCHBOX));
......@@ -799,8 +800,9 @@ void SearchBoxView::SetupAssistantButton() {
views::ImageButton* assistant = assistant_button();
assistant->SetImage(
views::ImageButton::STATE_NORMAL,
gfx::CreateVectorIcon(kAssistantIcon, search_box::kIconSize,
gfx::kGoogleGrey700));
gfx::CreateVectorIcon(
kAssistantIcon, search_box::kIconSize,
AppListColorProvider::Get()->GetSearchBoxIconColor()));
base::string16 assistant_button_label(
l10n_util::GetStringUTF16(IDS_APP_LIST_START_ASSISTANT));
assistant->SetAccessibleName(assistant_button_label);
......
......@@ -28,6 +28,7 @@ class ASH_PUBLIC_EXPORT AppListColorProvider {
virtual SkColor GetPageSwitcherButtonColor() const = 0;
virtual SkColor GetPageSwitcherInkDropBaseColor() const = 0;
virtual SkColor GetPageSwitcherInkDropHighlightColor() const = 0;
virtual SkColor GetSearchBoxIconColor() const = 0;
protected:
AppListColorProvider();
......
......@@ -7,13 +7,14 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/chromeos/search_box/search_box_export.h"
#include "ui/gfx/color_palette.h"
namespace search_box {
// Default color used when wallpaper customized color is not available for
// searchbox, #000 at 87% opacity.
SEARCH_BOX_EXPORT constexpr SkColor kDefaultSearchboxColor =
SkColorSetARGB(0xDE, 0x00, 0x00, 0x00);
gfx::kGoogleGrey200;
// The horizontal padding of the box layout of the search box.
SEARCH_BOX_EXPORT constexpr int kPadding = 12;
......
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