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

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

Issue 2925893002: [Merge to M60] Fix crash of update-over-cellular icon (Closed)
Patch Set: 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..c90f9de1242a87621a720f1eae45a49ed57b4e8e 100644
--- a/ash/system/update/tray_update.cc
+++ b/ash/system/update/tray_update.cc
@@ -7,6 +7,7 @@
#include "ash/metrics/user_metrics_action.h"
#include "ash/public/interfaces/update.mojom.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "ash/session/session_controller.h"
#include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/strings/grit/ash_strings.h"
@@ -82,6 +83,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 +93,16 @@ class TrayUpdate::UpdateView : public ActionableView {
owner->update_over_cellular_available_) {
label_text = bundle.GetLocalizedString(
IDS_ASH_STATUS_TRAY_UPDATE_OVER_CELLULAR_AVAILABLE);
+ if (!Shell::Get()->session_controller()->ShouldEnableSettings()) {
+ // Disables the view if settings page is not enabled.
+ tri_view->SetEnabled(false);
+ update_label_->SetEnabled(false);
+ }
} 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);
« 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