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

Side by Side Diff: ash/common/system/update/tray_update.cc

Issue 2505783002: chromeos: Migrate SignOut and RequestRestartForUpdate to mojo interface (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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"
11 #include "ash/common/system/tray/system_tray_controller.h"
11 #include "ash/common/system/tray/system_tray_delegate.h" 12 #include "ash/common/system/tray/system_tray_delegate.h"
12 #include "ash/common/system/tray/system_tray_notifier.h" 13 #include "ash/common/system/tray/system_tray_notifier.h"
13 #include "ash/common/system/tray/tray_constants.h" 14 #include "ash/common/system/tray/tray_constants.h"
14 #include "ash/common/system/tray/tray_popup_item_style.h" 15 #include "ash/common/system/tray/tray_popup_item_style.h"
15 #include "ash/common/system/tray/tray_popup_utils.h" 16 #include "ash/common/system/tray/tray_popup_utils.h"
16 #include "ash/common/wm_shell.h" 17 #include "ash/common/wm_shell.h"
17 #include "ash/resources/vector_icons/vector_icons.h" 18 #include "ash/resources/vector_icons/vector_icons.h"
18 #include "grit/ash_resources.h" 19 #include "grit/ash_resources.h"
19 #include "grit/ash_strings.h" 20 #include "grit/ash_strings.h"
20 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 113
113 if (MaterialDesignController::IsSystemTrayMenuMaterial()) 114 if (MaterialDesignController::IsSystemTrayMenuMaterial())
114 SetInkDropMode(InkDropHostView::InkDropMode::ON); 115 SetInkDropMode(InkDropHostView::InkDropMode::ON);
115 } 116 }
116 117
117 ~UpdateView() override {} 118 ~UpdateView() override {}
118 119
119 private: 120 private:
120 // Overridden from ActionableView. 121 // Overridden from ActionableView.
121 bool PerformAction(const ui::Event& event) override { 122 bool PerformAction(const ui::Event& event) override {
122 WmShell::Get()->system_tray_delegate()->RequestRestartForUpdate(); 123 WmShell::Get()->system_tray_controller()->RequestRestartForUpdate();
123 WmShell::Get()->RecordUserMetricsAction( 124 WmShell::Get()->RecordUserMetricsAction(
124 UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED); 125 UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED);
125 CloseSystemBubble(); 126 CloseSystemBubble();
126 return true; 127 return true;
127 } 128 }
128 129
129 void OnNativeThemeChanged(const ui::NativeTheme* theme) override { 130 void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
130 ActionableView::OnNativeThemeChanged(theme); 131 ActionableView::OnNativeThemeChanged(theme);
131 132
132 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) 133 if (!MaterialDesignController::IsSystemTrayMenuMaterial())
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 168
168 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) { 169 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) {
169 if (MaterialDesignController::UseMaterialDesignSystemIcons()) 170 if (MaterialDesignController::UseMaterialDesignSystemIcons())
170 SetIconColor(IconColorForUpdateSeverity(info.severity, false)); 171 SetIconColor(IconColorForUpdateSeverity(info.severity, false));
171 else 172 else
172 SetImageFromResourceId(DecideResource(info.severity, false)); 173 SetImageFromResourceId(DecideResource(info.severity, false));
173 tray_view()->SetVisible(true); 174 tray_view()->SetVisible(true);
174 } 175 }
175 176
176 } // namespace ash 177 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698