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

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

Issue 2915383002: Fix crash of update-over-cellular icon (Closed)
Patch Set: Disable the icon in locked and login screen instead of OOBE Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/upgrade_detector_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | chrome/browser/chromeos/upgrade_detector_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698