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

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

Issue 2041233005: Moves ash::user::LoginStatus to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 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 unified diff | Download patch
« no previous file with comments | « ash/system/tray_update.h ('k') | ash/system/user/login_status.h » ('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/system/tray_update.h" 5 #include "ash/system/tray_update.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_widget.h" 9 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 TrayUpdate::~TrayUpdate() { 166 TrayUpdate::~TrayUpdate() {
167 Shell::GetInstance()->system_tray_notifier()->RemoveUpdateObserver(this); 167 Shell::GetInstance()->system_tray_notifier()->RemoveUpdateObserver(this);
168 } 168 }
169 169
170 bool TrayUpdate::GetInitialVisibility() { 170 bool TrayUpdate::GetInitialVisibility() {
171 UpdateInfo info; 171 UpdateInfo info;
172 Shell::GetInstance()->system_tray_delegate()->GetSystemUpdateInfo(&info); 172 Shell::GetInstance()->system_tray_delegate()->GetSystemUpdateInfo(&info);
173 return info.update_required; 173 return info.update_required;
174 } 174 }
175 175
176 views::View* TrayUpdate::CreateDefaultView(user::LoginStatus status) { 176 views::View* TrayUpdate::CreateDefaultView(LoginStatus status) {
177 UpdateInfo info; 177 UpdateInfo info;
178 Shell::GetInstance()->system_tray_delegate()->GetSystemUpdateInfo(&info); 178 Shell::GetInstance()->system_tray_delegate()->GetSystemUpdateInfo(&info);
179 return info.update_required ? new UpdateView(info) : nullptr; 179 return info.update_required ? new UpdateView(info) : nullptr;
180 } 180 }
181 181
182 views::View* TrayUpdate::CreateDetailedView(user::LoginStatus status) { 182 views::View* TrayUpdate::CreateDetailedView(LoginStatus status) {
183 return CreateDefaultView(status); 183 return CreateDefaultView(status);
184 } 184 }
185 185
186 void TrayUpdate::DestroyDetailedView() { 186 void TrayUpdate::DestroyDetailedView() {
187 if (nagger_) { 187 if (nagger_) {
188 // The nagger was being displayed. Now that the detailed view is being 188 // The nagger was being displayed. Now that the detailed view is being
189 // closed, that means either the user clicks on it to restart, or the user 189 // closed, that means either the user clicks on it to restart, or the user
190 // didn't click on it to restart. In either case, start the timer to show 190 // didn't click on it to restart. In either case, start the timer to show
191 // the nag reminder again after the specified time. 191 // the nag reminder again after the specified time.
192 nagger_->RestartTimer(); 192 nagger_->RestartTimer();
193 } 193 }
194 } 194 }
195 195
196 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) { 196 void TrayUpdate::OnUpdateRecommended(const UpdateInfo& info) {
197 SetImageFromResourceId(DecideResource(info.severity, false)); 197 SetImageFromResourceId(DecideResource(info.severity, false));
198 tray_view()->SetVisible(true); 198 tray_view()->SetVisible(true);
199 if (!Shell::GetPrimaryRootWindowController()->shelf_widget()->IsVisible() && 199 if (!Shell::GetPrimaryRootWindowController()->shelf_widget()->IsVisible() &&
200 !nagger_.get()) { 200 !nagger_.get()) {
201 // The shelf is not visible, and there is no nagger scheduled. 201 // The shelf is not visible, and there is no nagger scheduled.
202 nagger_.reset(new tray::UpdateNagger(this)); 202 nagger_.reset(new tray::UpdateNagger(this));
203 } 203 }
204 } 204 }
205 205
206 } // namespace ash 206 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray_update.h ('k') | ash/system/user/login_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698