Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Unified Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc

Issue 2661023006: Remove unused references to NativeTheme in TrayPopupItemStyle. (Closed)
Patch Set: slight improvement Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index 1d2f344d4c2796151888f85e152c6f784a9549ad..794f74bf027be1050771c5e397f9dba4aa3e5d21 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -150,14 +150,16 @@ class ImeTitleView : public views::View, public views::ButtonListener {
box_layout->set_minimum_cross_axis_size(
GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT));
SetLayoutManager(box_layout);
- title_label_ =
+ auto title_label =
new views::Label(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME));
- title_label_->SetBorder(views::CreateEmptyBorder(
+ title_label->SetBorder(views::CreateEmptyBorder(
0, kMenuEdgeEffectivePadding, kTrayMenuBottomRowPadding, 0));
- UpdateStyle();
- title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- AddChildView(title_label_);
- box_layout->SetFlexForView(title_label_, 1);
+ title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::TITLE);
+ style.SetupLabel(title_label);
+
+ AddChildView(title_label);
+ box_layout->SetFlexForView(title_label, 1);
if (show_settings_button) {
settings_button_ = CreateImeMenuButton(
@@ -168,21 +170,6 @@ class ImeTitleView : public views::View, public views::ButtonListener {
}
}
- void UpdateStyle() {
- if (!GetNativeTheme() || !title_label_) {
- return;
- }
-
- TrayPopupItemStyle style(GetNativeTheme(),
- TrayPopupItemStyle::FontStyle::TITLE);
- style.SetupLabel(title_label_);
- }
-
- // views::View:
- void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
- UpdateStyle();
- }
-
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override {
DCHECK_EQ(sender, settings_button_);
@@ -192,8 +179,6 @@ class ImeTitleView : public views::View, public views::ButtonListener {
~ImeTitleView() override {}
private:
- views::Label* title_label_;
-
// Settings button that is only used in material design, and only if the
// emoji, handwriting and voice buttons are not available.
SystemMenuButton* settings_button_;
« no previous file with comments | « ash/common/system/chromeos/ime_menu/ime_list_view.cc ('k') | ash/common/system/chromeos/network/network_list_md.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698