| 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/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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (!Shell::GetInstance()->system_tray_delegate()->SystemShouldUpgrade()) | 174 if (!Shell::GetInstance()->system_tray_delegate()->SystemShouldUpgrade()) |
| 175 return NULL; | 175 return NULL; |
| 176 return new UpdateView(severity_); | 176 return new UpdateView(severity_); |
| 177 } | 177 } |
| 178 | 178 |
| 179 views::View* TrayUpdate::CreateDetailedView(user::LoginStatus status) { | 179 views::View* TrayUpdate::CreateDetailedView(user::LoginStatus status) { |
| 180 return CreateDefaultView(status); | 180 return CreateDefaultView(status); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void TrayUpdate::DestroyDetailedView() { | 183 void TrayUpdate::DestroyDetailedView() { |
| 184 if (nagger_.get()) { | 184 if (nagger_) { |
| 185 // The nagger was being displayed. Now that the detailed view is being | 185 // The nagger was being displayed. Now that the detailed view is being |
| 186 // closed, that means either the user clicks on it to restart, or the user | 186 // closed, that means either the user clicks on it to restart, or the user |
| 187 // didn't click on it to restart. In either case, start the timer to show | 187 // didn't click on it to restart. In either case, start the timer to show |
| 188 // the nag reminder again after the specified time. | 188 // the nag reminder again after the specified time. |
| 189 nagger_->RestartTimer(); | 189 nagger_->RestartTimer(); |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 void TrayUpdate::OnUpdateRecommended(UpdateObserver::UpdateSeverity severity) { | 193 void TrayUpdate::OnUpdateRecommended(UpdateObserver::UpdateSeverity severity) { |
| 194 severity_ = severity; | 194 severity_ = severity; |
| 195 SetImageFromResourceId(DecideResource(severity_, false)); | 195 SetImageFromResourceId(DecideResource(severity_, false)); |
| 196 tray_view()->SetVisible(true); | 196 tray_view()->SetVisible(true); |
| 197 if (!Shell::GetPrimaryRootWindowController()->shelf()->IsVisible() && | 197 if (!Shell::GetPrimaryRootWindowController()->shelf()->IsVisible() && |
| 198 !nagger_.get()) { | 198 !nagger_.get()) { |
| 199 // The shelf is not visible, and there is no nagger scheduled. | 199 // The shelf is not visible, and there is no nagger scheduled. |
| 200 nagger_.reset(new tray::UpdateNagger(this)); | 200 nagger_.reset(new tray::UpdateNagger(this)); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace internal | 204 } // namespace internal |
| 205 } // namespace ash | 205 } // namespace ash |
| OLD | NEW |