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

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

Issue 2193913002: Added Ash.SystemMenu.DefaultView.VisibleRows histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Merge remote-tracking branch 'refs/remotes/branch-heads/2785' into drover_2785 Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « ash/common/system/tray_accessibility.cc ('k') | ash/common/system/user/tray_user_separator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/metrics/user_metrics_action.h" 7 #include "ash/common/metrics/user_metrics_action.h"
8 #include "ash/common/system/tray/fixed_sized_image_view.h" 8 #include "ash/common/system/tray/fixed_sized_image_view.h"
9 #include "ash/common/system/tray/system_tray_delegate.h" 9 #include "ash/common/system/tray/system_tray_delegate.h"
10 #include "ash/common/system/tray/system_tray_notifier.h" 10 #include "ash/common/system/tray/system_tray_notifier.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return true; 78 return true;
79 } 79 }
80 80
81 DISALLOW_COPY_AND_ASSIGN(UpdateView); 81 DISALLOW_COPY_AND_ASSIGN(UpdateView);
82 }; 82 };
83 } 83 }
84 84
85 namespace ash { 85 namespace ash {
86 86
87 TrayUpdate::TrayUpdate(SystemTray* system_tray) 87 TrayUpdate::TrayUpdate(SystemTray* system_tray)
88 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_UPDATE) { 88 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_UPDATE, UMA_UPDATE) {
89 WmShell::Get()->system_tray_notifier()->AddUpdateObserver(this); 89 WmShell::Get()->system_tray_notifier()->AddUpdateObserver(this);
90 } 90 }
91 91
92 TrayUpdate::~TrayUpdate() { 92 TrayUpdate::~TrayUpdate() {
93 WmShell::Get()->system_tray_notifier()->RemoveUpdateObserver(this); 93 WmShell::Get()->system_tray_notifier()->RemoveUpdateObserver(this);
94 } 94 }
95 95
96 bool TrayUpdate::GetInitialVisibility() { 96 bool TrayUpdate::GetInitialVisibility() {
97 UpdateInfo info; 97 UpdateInfo info;
98 WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo(&info); 98 WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo(&info);
99 return info.update_required; 99 return info.update_required;
100 } 100 }
101 101
102 views::View* TrayUpdate::CreateDefaultView(LoginStatus status) { 102 views::View* TrayUpdate::CreateDefaultView(LoginStatus status) {
103 UpdateInfo info; 103 UpdateInfo info;
104 WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo(&info); 104 WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo(&info);
105 return info.update_required ? new UpdateView(info) : nullptr; 105 return info.update_required ? new UpdateView(info) : nullptr;
106 } 106 }
107 107
108 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) { 108 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) {
109 SetImageFromResourceId(DecideResource(info.severity, false)); 109 SetImageFromResourceId(DecideResource(info.severity, false));
110 tray_view()->SetVisible(true); 110 tray_view()->SetVisible(true);
111 } 111 }
112 112
113 } // namespace ash 113 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray_accessibility.cc ('k') | ash/common/system/user/tray_user_separator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698