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

dark_mode: Clean up |use_unified_theme_|.

Unified system tray had been launched long time ago.
|use_unified_theme_| is always true now.

Bug: 1131543
Change-Id: I38ceb731b02e774a8f8ee44577077cdeb5103f18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2508635
Commit-Queue: Min Chen <minch@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823701}
parent 69df2d6e
...@@ -51,8 +51,7 @@ class ImeListItemView : public ActionableView { ...@@ -51,8 +51,7 @@ class ImeListItemView : public ActionableView {
const base::string16& id, const base::string16& id,
const base::string16& label, const base::string16& label,
bool selected, bool selected,
const SkColor button_color, const SkColor button_color)
bool use_unified_theme)
: ActionableView(TrayPopupInkDropStyle::FILL_BOUNDS), : ActionableView(TrayPopupInkDropStyle::FILL_BOUNDS),
ime_list_view_(list_view), ime_list_view_(list_view),
selected_(selected) { selected_(selected) {
...@@ -64,11 +63,9 @@ class ImeListItemView : public ActionableView { ...@@ -64,11 +63,9 @@ class ImeListItemView : public ActionableView {
// |id_label| contains the IME short name (e.g., 'US', 'GB', 'IT'). // |id_label| contains the IME short name (e.g., 'US', 'GB', 'IT').
views::Label* id_label = TrayPopupUtils::CreateDefaultLabel(); views::Label* id_label = TrayPopupUtils::CreateDefaultLabel();
if (use_unified_theme) {
id_label->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor( id_label->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary)); AshColorProvider::ContentLayerType::kTextColorPrimary));
id_label->SetAutoColorReadabilityEnabled(false); id_label->SetAutoColorReadabilityEnabled(false);
}
id_label->SetText(id); id_label->SetText(id);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
const gfx::FontList& base_font_list = const gfx::FontList& base_font_list =
...@@ -90,8 +87,8 @@ class ImeListItemView : public ActionableView { ...@@ -90,8 +87,8 @@ class ImeListItemView : public ActionableView {
// The label shows the IME full name. // The label shows the IME full name.
auto* label_view = TrayPopupUtils::CreateDefaultLabel(); auto* label_view = TrayPopupUtils::CreateDefaultLabel();
label_view->SetText(label); label_view->SetText(label);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL, TrayPopupItemStyle style(
use_unified_theme); TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL);
style.SetupLabel(label_view); style.SetupLabel(label_view);
label_view->SetHorizontalAlignment(gfx::ALIGN_LEFT); label_view->SetHorizontalAlignment(gfx::ALIGN_LEFT);
...@@ -151,7 +148,7 @@ class KeyboardStatusRow : public views::View { ...@@ -151,7 +148,7 @@ class KeyboardStatusRow : public views::View {
views::ToggleButton* toggle() const { return toggle_; } views::ToggleButton* toggle() const { return toggle_; }
void Init(views::Button::PressedCallback callback, bool use_unified_theme) { void Init(views::Button::PressedCallback callback) {
TrayPopupUtils::ConfigureAsStickyHeader(this); TrayPopupUtils::ConfigureAsStickyHeader(this);
SetLayoutManager(std::make_unique<views::FillLayout>()); SetLayoutManager(std::make_unique<views::FillLayout>());
...@@ -170,8 +167,8 @@ class KeyboardStatusRow : public views::View { ...@@ -170,8 +167,8 @@ class KeyboardStatusRow : public views::View {
auto* label = TrayPopupUtils::CreateDefaultLabel(); auto* label = TrayPopupUtils::CreateDefaultLabel();
label->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( label->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD));
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL, TrayPopupItemStyle style(
use_unified_theme); TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL);
style.SetupLabel(label); style.SetupLabel(label);
tri_view->AddView(TriView::Container::CENTER, label); tri_view->AddView(TriView::Container::CENTER, label);
...@@ -194,14 +191,7 @@ class KeyboardStatusRow : public views::View { ...@@ -194,14 +191,7 @@ class KeyboardStatusRow : public views::View {
}; };
ImeListView::ImeListView(DetailedViewDelegate* delegate) ImeListView::ImeListView(DetailedViewDelegate* delegate)
: ImeListView(delegate, true) {} : TrayDetailedView(delegate) {}
ImeListView::ImeListView(DetailedViewDelegate* delegate, bool use_unified_theme)
: TrayDetailedView(delegate),
last_item_selected_with_keyboard_(false),
should_focus_ime_after_selection_with_keyboard_(false),
current_ime_view_(nullptr),
use_unified_theme_(use_unified_theme) {}
ImeListView::~ImeListView() = default; ImeListView::~ImeListView() = default;
...@@ -269,8 +259,7 @@ void ImeListView::AppendImeListAndProperties( ...@@ -269,8 +259,7 @@ void ImeListView::AppendImeListAndProperties(
views::View* ime_view = new ImeListItemView( views::View* ime_view = new ImeListItemView(
this, list[i].short_name, list[i].name, selected, this, list[i].short_name, list[i].name, selected,
AshColorProvider::Get()->GetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorProminent), AshColorProvider::ContentLayerType::kIconColorProminent));
use_unified_theme_);
scroll_content()->AddChildView(ime_view); scroll_content()->AddChildView(ime_view);
ime_map_[ime_view] = list[i].id; ime_map_[ime_view] = list[i].id;
...@@ -287,9 +276,9 @@ void ImeListView::AppendImeListAndProperties( ...@@ -287,9 +276,9 @@ void ImeListView::AppendImeListAndProperties(
AshColorProvider::ContentLayerType::kIconColorPrimary); AshColorProvider::ContentLayerType::kIconColorPrimary);
// Adds the property items. // Adds the property items.
for (size_t i = 0; i < property_list.size(); i++) { for (size_t i = 0; i < property_list.size(); i++) {
ImeListItemView* property_view = new ImeListItemView( ImeListItemView* property_view =
this, base::string16(), property_list[i].label, new ImeListItemView(this, base::string16(), property_list[i].label,
property_list[i].checked, icon_color, use_unified_theme_); property_list[i].checked, icon_color);
scroll_content()->AddChildView(property_view); scroll_content()->AddChildView(property_view);
property_map_[property_view] = property_list[i].key; property_map_[property_view] = property_list[i].key;
} }
...@@ -306,10 +295,8 @@ void ImeListView::AppendImeListAndProperties( ...@@ -306,10 +295,8 @@ void ImeListView::AppendImeListAndProperties(
void ImeListView::PrependKeyboardStatusRow() { void ImeListView::PrependKeyboardStatusRow() {
DCHECK(!keyboard_status_row_); DCHECK(!keyboard_status_row_);
keyboard_status_row_ = new KeyboardStatusRow; keyboard_status_row_ = new KeyboardStatusRow;
keyboard_status_row_->Init( keyboard_status_row_->Init(base::BindRepeating(
base::BindRepeating(&ImeListView::KeyboardStatusTogglePressed, &ImeListView::KeyboardStatusTogglePressed, base::Unretained(this)));
base::Unretained(this)),
use_unified_theme_);
scroll_content()->AddChildViewAt(keyboard_status_row_, 0); scroll_content()->AddChildViewAt(keyboard_status_row_, 0);
} }
......
...@@ -30,10 +30,7 @@ class ImeListView : public TrayDetailedView { ...@@ -30,10 +30,7 @@ class ImeListView : public TrayDetailedView {
HIDE_SINGLE_IME HIDE_SINGLE_IME
}; };
// The former uses default for |use_unified_theme|.
explicit ImeListView(DetailedViewDelegate* delegate); explicit ImeListView(DetailedViewDelegate* delegate);
ImeListView(DetailedViewDelegate* delegate, bool use_unified_theme);
~ImeListView() override; ~ImeListView() override;
// Initializes the contents of a newly-instantiated ImeListView. // Initializes the contents of a newly-instantiated ImeListView.
...@@ -103,16 +100,14 @@ class ImeListView : public TrayDetailedView { ...@@ -103,16 +100,14 @@ class ImeListView : public TrayDetailedView {
std::string last_selected_item_id_; std::string last_selected_item_id_;
// True if the last item is selected with keyboard. // True if the last item is selected with keyboard.
bool last_item_selected_with_keyboard_; bool last_item_selected_with_keyboard_ = false;
// True if focus should be requested after switching IMEs with keyboard in // True if focus should be requested after switching IMEs with keyboard in
// order to trigger spoken feedback with ChromeVox enabled. // order to trigger spoken feedback with ChromeVox enabled.
bool should_focus_ime_after_selection_with_keyboard_; bool should_focus_ime_after_selection_with_keyboard_ = false;
// The item view of the current selected IME. // The item view of the current selected IME.
views::View* current_ime_view_; views::View* current_ime_view_ = nullptr;
const bool use_unified_theme_;
DISALLOW_COPY_AND_ASSIGN(ImeListView); DISALLOW_COPY_AND_ASSIGN(ImeListView);
}; };
......
...@@ -146,8 +146,7 @@ class ImeTitleView : public views::View, public views::ButtonListener { ...@@ -146,8 +146,7 @@ class ImeTitleView : public views::View, public views::ButtonListener {
title_label->SetBorder( title_label->SetBorder(
views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 1, 0)); views::CreateEmptyBorder(0, kMenuEdgeEffectivePadding, 1, 0));
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER, TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER);
true /* use_unified_theme */);
style.SetupLabel(title_label); style.SetupLabel(title_label);
AddChildView(title_label); AddChildView(title_label);
...@@ -288,7 +287,7 @@ class ImeMenuListView : public ImeListView { ...@@ -288,7 +287,7 @@ class ImeMenuListView : public ImeListView {
}; };
explicit ImeMenuListView(std::unique_ptr<Delegate> delegate) explicit ImeMenuListView(std::unique_ptr<Delegate> delegate)
: ImeListView(delegate.get(), true /* use_unified_theme */) { : ImeListView(delegate.get()) {
set_should_focus_ime_after_selection_with_keyboard(true); set_should_focus_ime_after_selection_with_keyboard(true);
delegate_ = std::move(delegate); delegate_ = std::move(delegate);
} }
......
...@@ -65,8 +65,8 @@ class LocaleItem : public ActionableView { ...@@ -65,8 +65,8 @@ class LocaleItem : public ActionableView {
auto* display_name_view = TrayPopupUtils::CreateDefaultLabel(); auto* display_name_view = TrayPopupUtils::CreateDefaultLabel();
display_name_view->SetText(display_name); display_name_view->SetText(display_name);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL, TrayPopupItemStyle style(
true /* use_unified_theme */); TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL);
style.SetupLabel(display_name_view); style.SetupLabel(display_name_view);
display_name_view->SetHorizontalAlignment(gfx::ALIGN_LEFT); display_name_view->SetHorizontalAlignment(gfx::ALIGN_LEFT);
......
...@@ -78,7 +78,7 @@ views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) { ...@@ -78,7 +78,7 @@ views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {
AshColorProvider::ContentLayerType::kButtonIconColor); AshColorProvider::ContentLayerType::kButtonIconColor);
gfx::ImageSkia icon = gfx::ImageSkia icon =
CreateVectorIcon(GetPaletteIcon(), kMenuIconSize, icon_color); CreateVectorIcon(GetPaletteIcon(), kMenuIconSize, icon_color);
highlight_view_ = new HoverHighlightView(this, true /* use_unified_theme */); highlight_view_ = new HoverHighlightView(this);
highlight_view_->AddIconAndLabel(icon, name); highlight_view_->AddIconAndLabel(icon, name);
return highlight_view_; return highlight_view_;
} }
......
...@@ -104,8 +104,7 @@ class TitleView : public views::View { ...@@ -104,8 +104,7 @@ class TitleView : public views::View {
new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE)); new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STYLUS_TOOLS_TITLE));
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(title_label); AddChildView(title_label);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SMALL_TITLE, TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SMALL_TITLE);
true /* use_unified_theme */);
style.SetupLabel(title_label); style.SetupLabel(title_label);
layout_ptr->SetFlexForView(title_label, 1); layout_ptr->SetFlexForView(title_label, 1);
help_button_ = new TopShortcutButton( help_button_ = new TopShortcutButton(
......
...@@ -218,9 +218,7 @@ void MetalayerMode::UpdateView() { ...@@ -218,9 +218,7 @@ void MetalayerMode::UpdateView() {
highlight_view_->SetAccessibleName(text); highlight_view_->SetAccessibleName(text);
highlight_view_->SetEnabled(selectable()); highlight_view_->SetEnabled(selectable());
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL,
true /* use_unified_theme */);
style.set_color_style(highlight_view_->GetEnabled() style.set_color_style(highlight_view_->GetEnabled()
? TrayPopupItemStyle::ColorStyle::ACTIVE ? TrayPopupItemStyle::ColorStyle::ACTIVE
: TrayPopupItemStyle::ColorStyle::DISABLED); : TrayPopupItemStyle::ColorStyle::DISABLED);
......
...@@ -125,8 +125,7 @@ PhoneStatusView::PhoneStatusView(chromeos::phonehub::PhoneModel* phone_model, ...@@ -125,8 +125,7 @@ PhoneStatusView::PhoneStatusView(chromeos::phonehub::PhoneModel* phone_model,
phone_model_->AddObserver(this); phone_model_->AddObserver(this);
phone_name_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); phone_name_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER, TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER);
true /* use_unified_theme */);
style.SetupLabel(phone_name_label_); style.SetupLabel(phone_name_label_);
phone_name_label_->SetElideBehavior(gfx::ElideBehavior::ELIDE_TAIL); phone_name_label_->SetElideBehavior(gfx::ElideBehavior::ELIDE_TAIL);
AddView(TriView::Container::START, phone_name_label_); AddView(TriView::Container::START, phone_name_label_);
......
...@@ -131,8 +131,7 @@ TriView* DetailedViewDelegate::CreateTitleRow(int string_id) { ...@@ -131,8 +131,7 @@ TriView* DetailedViewDelegate::CreateTitleRow(int string_id) {
auto* label = TrayPopupUtils::CreateDefaultLabel(); auto* label = TrayPopupUtils::CreateDefaultLabel();
label->SetText(l10n_util::GetStringUTF16(string_id)); label->SetText(l10n_util::GetStringUTF16(string_id));
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE, TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE);
true /* use_unified_theme */);
style.SetupLabel(label); style.SetupLabel(label);
tri_view->AddView(TriView::Container::CENTER, label); tri_view->AddView(TriView::Container::CENTER, label);
...@@ -182,8 +181,7 @@ HoverHighlightView* DetailedViewDelegate::CreateScrollListItem( ...@@ -182,8 +181,7 @@ HoverHighlightView* DetailedViewDelegate::CreateScrollListItem(
ViewClickListener* listener, ViewClickListener* listener,
const gfx::VectorIcon& icon, const gfx::VectorIcon& icon,
const base::string16& text) { const base::string16& text) {
HoverHighlightView* item = HoverHighlightView* item = new HoverHighlightView(listener);
new HoverHighlightView(listener, true /* use_unified_theme */);
if (icon.is_empty()) if (icon.is_empty())
item->AddLabelRow(text); item->AddLabelRow(text);
else else
......
...@@ -25,13 +25,7 @@ ...@@ -25,13 +25,7 @@
namespace ash { namespace ash {
HoverHighlightView::HoverHighlightView(ViewClickListener* listener) HoverHighlightView::HoverHighlightView(ViewClickListener* listener)
: HoverHighlightView(listener, true) {} : ActionableView(TrayPopupInkDropStyle::FILL_BOUNDS), listener_(listener) {
HoverHighlightView::HoverHighlightView(ViewClickListener* listener,
bool use_unified_theme)
: ActionableView(TrayPopupInkDropStyle::FILL_BOUNDS),
listener_(listener),
use_unified_theme_(use_unified_theme) {
SetNotifyEnterExitOnChild(true); SetNotifyEnterExitOnChild(true);
SetInkDropMode(InkDropMode::ON); SetInkDropMode(InkDropMode::ON);
} }
...@@ -86,8 +80,7 @@ void HoverHighlightView::SetSubText(const base::string16& sub_text) { ...@@ -86,8 +80,7 @@ void HoverHighlightView::SetSubText(const base::string16& sub_text) {
tri_view_->AddView(TriView::Container::CENTER, sub_text_label_); tri_view_->AddView(TriView::Container::CENTER, sub_text_label_);
} }
TrayPopupItemStyle sub_style(TrayPopupItemStyle::FontStyle::CAPTION, TrayPopupItemStyle sub_style(TrayPopupItemStyle::FontStyle::CAPTION);
use_unified_theme_);
sub_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE); sub_style.set_color_style(TrayPopupItemStyle::ColorStyle::INACTIVE);
sub_style.SetupLabel(sub_text_label_); sub_style.SetupLabel(sub_text_label_);
sub_text_label_->SetText(sub_text); sub_text_label_->SetText(sub_text);
...@@ -118,7 +111,7 @@ void HoverHighlightView::DoAddIconAndLabel( ...@@ -118,7 +111,7 @@ void HoverHighlightView::DoAddIconAndLabel(
text_label_ = TrayPopupUtils::CreateUnfocusableLabel(); text_label_ = TrayPopupUtils::CreateUnfocusableLabel();
text_label_->SetText(text); text_label_->SetText(text);
text_label_->SetEnabled(GetEnabled()); text_label_->SetEnabled(GetEnabled());
TrayPopupItemStyle style(font_style, use_unified_theme_); TrayPopupItemStyle style(font_style);
style.SetupLabel(text_label_); style.SetupLabel(text_label_);
tri_view_->AddView(TriView::Container::CENTER, text_label_); tri_view_->AddView(TriView::Container::CENTER, text_label_);
// By default, END container is invisible, so labels in the CENTER should have // By default, END container is invisible, so labels in the CENTER should have
...@@ -142,8 +135,7 @@ void HoverHighlightView::AddLabelRow(const base::string16& text) { ...@@ -142,8 +135,7 @@ void HoverHighlightView::AddLabelRow(const base::string16& text) {
text_label_ = TrayPopupUtils::CreateUnfocusableLabel(); text_label_ = TrayPopupUtils::CreateUnfocusableLabel();
text_label_->SetText(text); text_label_->SetText(text);
TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL, TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL);
use_unified_theme_);
style.SetupLabel(text_label_); style.SetupLabel(text_label_);
tri_view_->AddView(TriView::Container::CENTER, text_label_); tri_view_->AddView(TriView::Container::CENTER, text_label_);
......
...@@ -40,9 +40,7 @@ class HoverHighlightView : public ActionableView { ...@@ -40,9 +40,7 @@ class HoverHighlightView : public ActionableView {
}; };
// If |listener| is null then no action is taken on click. // If |listener| is null then no action is taken on click.
// The former uses default for |use_unified_theme|.
explicit HoverHighlightView(ViewClickListener* listener); explicit HoverHighlightView(ViewClickListener* listener);
HoverHighlightView(ViewClickListener* listener, bool use_unified_theme);
~HoverHighlightView() override; ~HoverHighlightView() override;
// Convenience function for populating the view with an icon and a label. This // Convenience function for populating the view with an icon and a label. This
...@@ -128,7 +126,6 @@ class HoverHighlightView : public ActionableView { ...@@ -128,7 +126,6 @@ class HoverHighlightView : public ActionableView {
views::View* right_view_ = nullptr; views::View* right_view_ = nullptr;
TriView* tri_view_ = nullptr; TriView* tri_view_ = nullptr;
bool expandable_ = false; bool expandable_ = false;
const bool use_unified_theme_;
AccessibilityState accessibility_state_ = AccessibilityState::DEFAULT; AccessibilityState accessibility_state_ = AccessibilityState::DEFAULT;
views::PropertyChangedSubscription enabled_changed_subscription_ = views::PropertyChangedSubscription enabled_changed_subscription_ =
AddEnabledChangedCallback( AddEnabledChangedCallback(
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/font.h" #include "ui/gfx/font.h"
#include "ui/gfx/font_list.h" #include "ui/gfx/font_list.h"
#include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme.h"
...@@ -21,13 +20,9 @@ constexpr int kDisabledAlpha = 0x61; ...@@ -21,13 +20,9 @@ constexpr int kDisabledAlpha = 0x61;
} // namespace } // namespace
// static // static
SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style, SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style) {
bool use_unified_theme) { const SkColor kBaseIconColor = AshColorProvider::Get()->GetContentLayerColor(
const SkColor kBaseIconColor = AshColorProvider::ContentLayerType::kIconColorPrimary);
use_unified_theme
? AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary)
: gfx::kChromeIconGrey;
switch (color_style) { switch (color_style) {
case ColorStyle::ACTIVE: case ColorStyle::ACTIVE:
return kBaseIconColor; return kBaseIconColor;
...@@ -43,13 +38,7 @@ SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style, ...@@ -43,13 +38,7 @@ SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style,
} }
TrayPopupItemStyle::TrayPopupItemStyle(FontStyle font_style) TrayPopupItemStyle::TrayPopupItemStyle(FontStyle font_style)
: TrayPopupItemStyle(font_style, true) {} : font_style_(font_style), color_style_(ColorStyle::ACTIVE) {
TrayPopupItemStyle::TrayPopupItemStyle(FontStyle font_style,
bool use_unified_theme)
: font_style_(font_style),
color_style_(ColorStyle::ACTIVE),
use_unified_theme_(use_unified_theme) {
if (font_style_ == FontStyle::SYSTEM_INFO) if (font_style_ == FontStyle::SYSTEM_INFO)
color_style_ = ColorStyle::INACTIVE; color_style_ = ColorStyle::INACTIVE;
} }
...@@ -57,11 +46,8 @@ TrayPopupItemStyle::TrayPopupItemStyle(FontStyle font_style, ...@@ -57,11 +46,8 @@ TrayPopupItemStyle::TrayPopupItemStyle(FontStyle font_style,
TrayPopupItemStyle::~TrayPopupItemStyle() = default; TrayPopupItemStyle::~TrayPopupItemStyle() = default;
SkColor TrayPopupItemStyle::GetTextColor() const { SkColor TrayPopupItemStyle::GetTextColor() const {
const SkColor kBaseTextColor = const SkColor kBaseTextColor = AshColorProvider::Get()->GetContentLayerColor(
use_unified_theme_ AshColorProvider::ContentLayerType::kTextColorPrimary);
? AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary)
: SkColorSetA(SK_ColorBLACK, 0xDE);
switch (color_style_) { switch (color_style_) {
case ColorStyle::ACTIVE: case ColorStyle::ACTIVE:
...@@ -79,7 +65,7 @@ SkColor TrayPopupItemStyle::GetTextColor() const { ...@@ -79,7 +65,7 @@ SkColor TrayPopupItemStyle::GetTextColor() const {
} }
SkColor TrayPopupItemStyle::GetIconColor() const { SkColor TrayPopupItemStyle::GetIconColor() const {
return GetIconColor(color_style_, use_unified_theme_); return GetIconColor(color_style_);
} }
void TrayPopupItemStyle::SetupLabel(views::Label* label) const { void TrayPopupItemStyle::SetupLabel(views::Label* label) const {
...@@ -89,8 +75,7 @@ void TrayPopupItemStyle::SetupLabel(views::Label* label) const { ...@@ -89,8 +75,7 @@ void TrayPopupItemStyle::SetupLabel(views::Label* label) const {
const gfx::FontList& base_font_list = views::Label::GetDefaultFontList(); const gfx::FontList& base_font_list = views::Label::GetDefaultFontList();
switch (font_style_) { switch (font_style_) {
case FontStyle::TITLE: case FontStyle::TITLE:
label->SetFontList(base_font_list.Derive(use_unified_theme_ ? 8 : 1, label->SetFontList(base_font_list.Derive(8, gfx::Font::NORMAL,
gfx::Font::NORMAL,
gfx::Font::Weight::MEDIUM)); gfx::Font::Weight::MEDIUM));
break; break;
case FontStyle::SMALL_TITLE: case FontStyle::SMALL_TITLE:
......
...@@ -53,13 +53,9 @@ class TrayPopupItemStyle { ...@@ -53,13 +53,9 @@ class TrayPopupItemStyle {
static constexpr double kInactiveIconAlpha = 0.54; static constexpr double kInactiveIconAlpha = 0.54;
static SkColor GetIconColor(ColorStyle color_style, static SkColor GetIconColor(ColorStyle color_style);
bool use_unified_theme = false);
// The first constructor initializes |use_unified_theme_| with default. See
// the comment below.
explicit TrayPopupItemStyle(FontStyle font_style); explicit TrayPopupItemStyle(FontStyle font_style);
TrayPopupItemStyle(FontStyle font_style, bool use_unified_theme);
~TrayPopupItemStyle(); ~TrayPopupItemStyle();
void set_color_style(ColorStyle color_style) { color_style_ = color_style; } void set_color_style(ColorStyle color_style) { color_style_ = color_style; }
...@@ -80,11 +76,6 @@ class TrayPopupItemStyle { ...@@ -80,11 +76,6 @@ class TrayPopupItemStyle {
ColorStyle color_style_; ColorStyle color_style_;
// Use base colors for UnifiedSystemTray. If IsSystemTrayUnifiedEnabled() is
// true, the value is true by default.
// TODO(tetsui): Clean up this after UnifiedSystemTray is launched.
const bool use_unified_theme_;
DISALLOW_COPY_AND_ASSIGN(TrayPopupItemStyle); DISALLOW_COPY_AND_ASSIGN(TrayPopupItemStyle);
}; };
......
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