Commit b220f55c authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

Fix search box placeholder text color.

This CL removes the misnomer search_box_color_. It's  setter and getter
functions are never used. its only use is in search_box_view_base.cc
where it is used to set the placeholder text color.

Bug: 1139873
Change-Id: I2e05ae8c077dc2370aa28d5de518acbb69808f08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488600Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Reviewed-by: default avatarYulun Wu <yulunwu@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819104}
parent cf236389
......@@ -14,6 +14,9 @@ namespace ash {
// searchbox, #000 at 87% opacity.
constexpr SkColor kDefaultSearchboxColor = gfx::kGoogleGrey200;
constexpr SkColor kDefaultSearchboxPlaceholderTextColor =
SkColorSetARGB(0xDE, 0x00, 0x00, 0x00);
// The horizontal padding of the box layout of the search box.
constexpr int kSearchBoxPadding = 12;
......
......@@ -262,7 +262,8 @@ SearchBoxViewBase::SearchBoxViewBase(SearchBoxViewDelegate* delegate)
search_icon_ = new views::ImageView();
content_container_->AddChildView(search_icon_);
search_box_->set_placeholder_text_color(search_box_color_);
search_box_->set_placeholder_text_color(
kDefaultSearchboxPlaceholderTextColor);
search_box_->set_placeholder_text_draw_flags(gfx::Canvas::TEXT_ALIGN_CENTER);
search_box_->SetFontList(search_box_->GetFontList().DeriveWithSizeDelta(2));
search_box_->SetCursorEnabled(is_search_box_active_);
......@@ -339,8 +340,9 @@ void SearchBoxViewBase::SetSearchBoxActive(bool active,
active ? (base::i18n::IsRTL() ? gfx::Canvas::TEXT_ALIGN_RIGHT
: gfx::Canvas::TEXT_ALIGN_LEFT)
: gfx::Canvas::TEXT_ALIGN_CENTER);
search_box_->set_placeholder_text_color(active ? kZeroQuerySearchboxColor
: search_box_color_);
search_box_->set_placeholder_text_color(
active ? kZeroQuerySearchboxColor
: kDefaultSearchboxPlaceholderTextColor);
search_box_->SetCursorEnabled(active);
if (active) {
......@@ -457,11 +459,6 @@ void SearchBoxViewBase::NotifyActiveChanged() {
delegate_->ActiveChanged(this);
}
void SearchBoxViewBase::SetSearchBoxColor(SkColor color) {
search_box_color_ =
SK_ColorTRANSPARENT == color ? kDefaultSearchboxColor : color;
}
void SearchBoxViewBase::UpdateButtonsVisisbility() {
DCHECK(close_button_ && assistant_button_);
......
......@@ -128,10 +128,6 @@ class SearchBoxViewBase : public views::WidgetDelegateView,
// Nofifies the active status change.
void NotifyActiveChanged();
// Sets the search box color.
void SetSearchBoxColor(SkColor color);
SkColor search_box_color() const { return search_box_color_; }
// Updates the visibility of close button.
void UpdateButtonsVisisbility();
......@@ -206,8 +202,6 @@ class SearchBoxViewBase : public views::WidgetDelegateView,
bool show_close_button_when_active_ = false;
// Whether to show assistant button.
bool show_assistant_button_ = false;
// The current search box color.
SkColor search_box_color_ = kDefaultSearchboxColor;
views::PropertyChangedSubscription enabled_changed_subscription_ =
AddEnabledChangedCallback(
......
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