Chromium Code Reviews| Index: ash/system/update/tray_update.cc |
| diff --git a/ash/system/update/tray_update.cc b/ash/system/update/tray_update.cc |
| index 126b4a83f05622437feddbf806d20e29dd3eefa3..7adda0f240892a4d4ae4153419a99cd2c345ee34 100644 |
| --- a/ash/system/update/tray_update.cc |
| +++ b/ash/system/update/tray_update.cc |
| @@ -67,7 +67,7 @@ mojom::UpdateType TrayUpdate::update_type_ = mojom::UpdateType::SYSTEM; |
| // The "restart to update" item in the system tray menu. |
| class TrayUpdate::UpdateView : public ActionableView { |
| public: |
| - explicit UpdateView(TrayUpdate* owner) |
| + explicit UpdateView(TrayUpdate* owner, LoginStatus status) |
|
xiyuan
2017/06/05 16:12:52
nit: "explicit" can be removed since this is no lo
weidongg
2017/06/05 16:56:52
Removed the second parameter.
|
| : ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS), |
| update_label_(nullptr) { |
| SetLayoutManager(new views::FillLayout); |
| @@ -82,6 +82,7 @@ class TrayUpdate::UpdateView : public ActionableView { |
| tri_view->AddView(TriView::Container::START, image); |
| base::string16 label_text; |
| + update_label_ = TrayPopupUtils::CreateDefaultLabel(); |
| if (owner->factory_reset_required_) { |
| label_text = bundle.GetLocalizedString( |
| IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE); |
| @@ -91,12 +92,18 @@ class TrayUpdate::UpdateView : public ActionableView { |
| owner->update_over_cellular_available_) { |
| label_text = bundle.GetLocalizedString( |
| IDS_ASH_STATUS_TRAY_UPDATE_OVER_CELLULAR_AVAILABLE); |
| + if (status == LoginStatus::LOCKED || |
| + status == LoginStatus::NOT_LOGGED_IN) { |
|
xiyuan
2017/06/05 16:12:52
Should we call SessionController::ShouldEnableSett
weidongg
2017/06/05 16:56:52
Aha, yes, good to know this api. Thanks.
|
| + // Disables the view as clicking it opens settings page which is not |
| + // available in locked and login screen. |
| + tri_view->SetEnabled(false); |
| + update_label_->SetEnabled(false); |
|
xiyuan
2017/06/05 16:12:52
Does this only apply to cellular update available
weidongg
2017/06/05 16:56:52
The action of clicking in other update cases is re
|
| + } |
| } else { |
| label_text = bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE); |
| } |
| SetAccessibleName(label_text); |
| - update_label_ = TrayPopupUtils::CreateDefaultLabel(); |
| update_label_->SetText(label_text); |
| TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL); |
| @@ -143,7 +150,7 @@ bool TrayUpdate::GetInitialVisibility() { |
| views::View* TrayUpdate::CreateDefaultView(LoginStatus status) { |
| if (update_required_ || update_over_cellular_available_) { |
| - update_view_ = new UpdateView(this); |
| + update_view_ = new UpdateView(this, status); |
| return update_view_; |
| } |
| return nullptr; |