| 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/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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 ash::Shell::GetInstance()->system_tray_delegate(); | 68 ash::Shell::GetInstance()->system_tray_delegate(); |
| 69 DCHECK(delegate); | 69 DCHECK(delegate); |
| 70 // Initialize after all trays have been created. | 70 // Initialize after all trays have been created. |
| 71 system_tray_->InitializeTrayItems(delegate); | 71 system_tray_->InitializeTrayItems(delegate); |
| 72 web_notification_tray_->Initialize(); | 72 web_notification_tray_->Initialize(); |
| 73 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
| 74 logout_button_tray_->Initialize(); | 74 logout_button_tray_->Initialize(); |
| 75 virtual_keyboard_tray_->Initialize(); | 75 virtual_keyboard_tray_->Initialize(); |
| 76 #endif | 76 #endif |
| 77 overview_button_tray_->Initialize(); | 77 overview_button_tray_->Initialize(); |
| 78 SetShelfAlignment(system_tray_->shelf_alignment()); |
| 78 UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus()); | 79 UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus()); |
| 79 } | 80 } |
| 80 | 81 |
| 81 void StatusAreaWidget::Shutdown() { | 82 void StatusAreaWidget::Shutdown() { |
| 82 // Destroy the trays early, causing them to be removed from the view | 83 // Destroy the trays early, causing them to be removed from the view |
| 83 // hierarchy. Do not used scoped pointers since we don't want to destroy them | 84 // hierarchy. Do not used scoped pointers since we don't want to destroy them |
| 84 // in the destructor if Shutdown() is not called (e.g. in tests). | 85 // in the destructor if Shutdown() is not called (e.g. in tests). |
| 85 delete web_notification_tray_; | 86 delete web_notification_tray_; |
| 86 web_notification_tray_ = NULL; | 87 web_notification_tray_ = NULL; |
| 87 delete system_tray_; | 88 delete system_tray_; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 196 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
| 196 #if defined(OS_CHROMEOS) | 197 #if defined(OS_CHROMEOS) |
| 197 if (logout_button_tray_) | 198 if (logout_button_tray_) |
| 198 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); | 199 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 199 #endif | 200 #endif |
| 200 if (overview_button_tray_) | 201 if (overview_button_tray_) |
| 201 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); | 202 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace ash | 205 } // namespace ash |
| OLD | NEW |