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/system/update/tray_update.h" | 5 #include "ash/system/update/tray_update.h" |
6 | 6 |
7 #include "ash/metrics/user_metrics_action.h" | 7 #include "ash/metrics/user_metrics_action.h" |
8 #include "ash/public/interfaces/update.mojom.h" | 8 #include "ash/public/interfaces/update.mojom.h" |
9 #include "ash/resources/vector_icons/vector_icons.h" | 9 #include "ash/resources/vector_icons/vector_icons.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_port.h" |
11 #include "ash/strings/grit/ash_strings.h" | 12 #include "ash/strings/grit/ash_strings.h" |
12 #include "ash/system/tray/fixed_sized_image_view.h" | 13 #include "ash/system/tray/fixed_sized_image_view.h" |
13 #include "ash/system/tray/system_tray.h" | 14 #include "ash/system/tray/system_tray.h" |
14 #include "ash/system/tray/system_tray_controller.h" | 15 #include "ash/system/tray/system_tray_controller.h" |
15 #include "ash/system/tray/system_tray_delegate.h" | 16 #include "ash/system/tray/system_tray_delegate.h" |
16 #include "ash/system/tray/tray_constants.h" | 17 #include "ash/system/tray/tray_constants.h" |
17 #include "ash/system/tray/tray_popup_item_style.h" | 18 #include "ash/system/tray/tray_popup_item_style.h" |
18 #include "ash/system/tray/tray_popup_utils.h" | 19 #include "ash/system/tray/tray_popup_utils.h" |
19 #include "ash/wm_shell.h" | |
20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/gfx/color_palette.h" | 21 #include "ui/gfx/color_palette.h" |
22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
23 #include "ui/gfx/paint_vector_icon.h" | 23 #include "ui/gfx/paint_vector_icon.h" |
24 #include "ui/views/controls/image_view.h" | 24 #include "ui/views/controls/image_view.h" |
25 #include "ui/views/controls/label.h" | 25 #include "ui/views/controls/label.h" |
26 #include "ui/views/layout/fill_layout.h" | 26 #include "ui/views/layout/fill_layout.h" |
27 | 27 |
28 namespace ash { | 28 namespace ash { |
29 namespace { | 29 namespace { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 SetInkDropMode(InkDropHostView::InkDropMode::ON); | 92 SetInkDropMode(InkDropHostView::InkDropMode::ON); |
93 } | 93 } |
94 | 94 |
95 ~UpdateView() override {} | 95 ~UpdateView() override {} |
96 | 96 |
97 private: | 97 private: |
98 // Overridden from ActionableView. | 98 // Overridden from ActionableView. |
99 bool PerformAction(const ui::Event& event) override { | 99 bool PerformAction(const ui::Event& event) override { |
100 Shell::Get()->system_tray_controller()->RequestRestartForUpdate(); | 100 Shell::Get()->system_tray_controller()->RequestRestartForUpdate(); |
101 WmShell::Get()->RecordUserMetricsAction( | 101 ShellPort::Get()->RecordUserMetricsAction( |
102 UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED); | 102 UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED); |
103 CloseSystemBubble(); | 103 CloseSystemBubble(); |
104 return true; | 104 return true; |
105 } | 105 } |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(UpdateView); | 107 DISALLOW_COPY_AND_ASSIGN(UpdateView); |
108 }; | 108 }; |
109 | 109 |
110 TrayUpdate::TrayUpdate(SystemTray* system_tray) | 110 TrayUpdate::TrayUpdate(SystemTray* system_tray) |
111 : TrayImageItem(system_tray, kSystemTrayUpdateIcon, UMA_UPDATE) {} | 111 : TrayImageItem(system_tray, kSystemTrayUpdateIcon, UMA_UPDATE) {} |
(...skipping 16 matching lines...) Expand all Loading... |
128 update_required_ = true; | 128 update_required_ = true; |
129 severity_ = severity; | 129 severity_ = severity; |
130 factory_reset_required_ = factory_reset_required; | 130 factory_reset_required_ = factory_reset_required; |
131 | 131 |
132 // Show the icon in the tray. | 132 // Show the icon in the tray. |
133 SetIconColor(IconColorForUpdateSeverity(severity_, false)); | 133 SetIconColor(IconColorForUpdateSeverity(severity_, false)); |
134 tray_view()->SetVisible(true); | 134 tray_view()->SetVisible(true); |
135 } | 135 } |
136 | 136 |
137 } // namespace ash | 137 } // namespace ash |
OLD | NEW |