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

Unified Diff: ash/common/system/update/tray_update.cc

Issue 2661023006: Remove unused references to NativeTheme in TrayPopupItemStyle. (Closed)
Patch Set: inline/share more 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/update/tray_update.cc
diff --git a/ash/common/system/update/tray_update.cc b/ash/common/system/update/tray_update.cc
index 78a4469d81f0b2e01d158e477bcf7ad77a92df96..75be8f5dc4ccd2d27ce338796e7f06bc8cff260a 100644
--- a/ash/common/system/update/tray_update.cc
+++ b/ash/common/system/update/tray_update.cc
@@ -94,8 +94,7 @@ bool TrayUpdate::factory_reset_required_ = false;
class TrayUpdate::UpdateView : public ActionableView {
public:
explicit UpdateView(TrayUpdate* owner)
- : ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS),
- label_(nullptr) {
+ : ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS) {
SetLayoutManager(new views::FillLayout);
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
@@ -118,13 +117,14 @@ class TrayUpdate::UpdateView : public ActionableView {
? bundle.GetLocalizedString(
IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE)
: bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE);
- label_ = TrayPopupUtils::CreateDefaultLabel();
- label_->SetText(label_text);
SetAccessibleName(label_text);
- tri_view->AddView(TriView::Container::CENTER, label_);
+ auto label = TrayPopupUtils::CreateDefaultLabel();
+ label->SetText(label_text);
+ TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ style.SetupLabel(label);
+ tri_view->AddView(TriView::Container::CENTER, label);
if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
- UpdateStyle();
SetInkDropMode(InkDropHostView::InkDropMode::ON);
}
}
@@ -132,12 +132,6 @@ class TrayUpdate::UpdateView : public ActionableView {
~UpdateView() override {}
private:
- void UpdateStyle() {
- TrayPopupItemStyle style(GetNativeTheme(),
- TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
- style.SetupLabel(label_);
- }
-
// Overridden from ActionableView.
bool PerformAction(const ui::Event& event) override {
WmShell::Get()->system_tray_controller()->RequestRestartForUpdate();
@@ -147,16 +141,6 @@ class TrayUpdate::UpdateView : public ActionableView {
return true;
}
- void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
- ActionableView::OnNativeThemeChanged(theme);
-
- if (!MaterialDesignController::IsSystemTrayMenuMaterial())
- return;
- UpdateStyle();
- }
-
- views::Label* label_;
-
DISALLOW_COPY_AND_ASSIGN(UpdateView);
};

Powered by Google App Engine
This is Rietveld 408576698