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/status_area_widget.h" | 5 #include "ash/system/status_area_widget.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 void StatusAreaWidget::CreateTrayViews(ShellDelegate* shell_delegate) { | 299 void StatusAreaWidget::CreateTrayViews(ShellDelegate* shell_delegate) { |
300 AddWebNotificationTray(new WebNotificationTray(this)); | 300 AddWebNotificationTray(new WebNotificationTray(this)); |
301 AddSystemTray(new SystemTray(this), shell_delegate); | 301 AddSystemTray(new SystemTray(this), shell_delegate); |
302 } | 302 } |
303 | 303 |
304 void StatusAreaWidget::Shutdown() { | 304 void StatusAreaWidget::Shutdown() { |
305 // Destroy the trays early, causing them to be removed from the view | 305 // Destroy the trays early, causing them to be removed from the view |
306 // hierarchy. Do not used scoped pointers since we don't want to destroy them | 306 // hierarchy. Do not used scoped pointers since we don't want to destroy them |
307 // in the destructor if Shutdown() is not called (e.g. in tests). | 307 // in the destructor if Shutdown() is not called (e.g. in tests). |
| 308 system_tray_delegate_.reset(); |
308 delete system_tray_; | 309 delete system_tray_; |
309 system_tray_ = NULL; | 310 system_tray_ = NULL; |
310 delete web_notification_tray_; | 311 delete web_notification_tray_; |
311 web_notification_tray_ = NULL; | 312 web_notification_tray_ = NULL; |
312 } | 313 } |
313 | 314 |
314 void StatusAreaWidget::AddSystemTray(SystemTray* system_tray, | 315 void StatusAreaWidget::AddSystemTray(SystemTray* system_tray, |
315 ShellDelegate* shell_delegate) { | 316 ShellDelegate* shell_delegate) { |
316 system_tray_ = system_tray; | 317 system_tray_ = system_tray; |
317 widget_delegate_->AddTray(system_tray); | 318 widget_delegate_->AddTray(system_tray); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 user::LoginStatus login_status) { | 370 user::LoginStatus login_status) { |
370 login_status_ = login_status; | 371 login_status_ = login_status; |
371 if (system_tray_) | 372 if (system_tray_) |
372 system_tray_->UpdateAfterLoginStatusChange(login_status); | 373 system_tray_->UpdateAfterLoginStatusChange(login_status); |
373 if (web_notification_tray_) | 374 if (web_notification_tray_) |
374 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 375 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
375 } | 376 } |
376 | 377 |
377 } // namespace internal | 378 } // namespace internal |
378 } // namespace ash | 379 } // namespace ash |
OLD | NEW |