| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/system/update/tray_update.h" | 5 #include "ash/common/system/update/tray_update.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/metrics/user_metrics_action.h" | 8 #include "ash/common/metrics/user_metrics_action.h" |
| 9 #include "ash/common/system/tray/fixed_sized_image_view.h" | 9 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 AddChildView(image); | 101 AddChildView(image); |
| 102 | 102 |
| 103 base::string16 label_text = | 103 base::string16 label_text = |
| 104 info.factory_reset_required | 104 info.factory_reset_required |
| 105 ? bundle.GetLocalizedString( | 105 ? bundle.GetLocalizedString( |
| 106 IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE) | 106 IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE) |
| 107 : bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE); | 107 : bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE); |
| 108 label_ = new views::Label(label_text); | 108 label_ = new views::Label(label_text); |
| 109 AddChildView(label_); | 109 AddChildView(label_); |
| 110 SetAccessibleName(label_text); | 110 SetAccessibleName(label_text); |
| 111 |
| 112 if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
| 113 SetInkDropMode(InkDropHostView::InkDropMode::ON); |
| 111 } | 114 } |
| 112 | 115 |
| 113 ~UpdateView() override {} | 116 ~UpdateView() override {} |
| 114 | 117 |
| 115 private: | 118 private: |
| 116 // Overridden from ActionableView. | 119 // Overridden from ActionableView. |
| 117 bool PerformAction(const ui::Event& event) override { | 120 bool PerformAction(const ui::Event& event) override { |
| 118 WmShell::Get()->system_tray_delegate()->RequestRestartForUpdate(); | 121 WmShell::Get()->system_tray_delegate()->RequestRestartForUpdate(); |
| 119 WmShell::Get()->RecordUserMetricsAction( | 122 WmShell::Get()->RecordUserMetricsAction( |
| 120 UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED); | 123 UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 166 |
| 164 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) { | 167 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) { |
| 165 if (MaterialDesignController::UseMaterialDesignSystemIcons()) | 168 if (MaterialDesignController::UseMaterialDesignSystemIcons()) |
| 166 SetIconColor(IconColorForUpdateSeverity(info.severity, false)); | 169 SetIconColor(IconColorForUpdateSeverity(info.severity, false)); |
| 167 else | 170 else |
| 168 SetImageFromResourceId(DecideResource(info.severity, false)); | 171 SetImageFromResourceId(DecideResource(info.severity, false)); |
| 169 tray_view()->SetVisible(true); | 172 tray_view()->SetVisible(true); |
| 170 } | 173 } |
| 171 | 174 |
| 172 } // namespace ash | 175 } // namespace ash |
| OLD | NEW |