| 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/common/shelf/wm_shelf.h" | 7 #include "ash/common/shelf/wm_shelf.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/system/status_area_widget_delegate.h" | 9 #include "ash/common/system/status_area_widget_delegate.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" | 10 #include "ash/common/system/tray/system_tray_delegate.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 StatusAreaWidget::~StatusAreaWidget() {} | 52 StatusAreaWidget::~StatusAreaWidget() {} |
| 53 | 53 |
| 54 void StatusAreaWidget::CreateTrayViews() { | 54 void StatusAreaWidget::CreateTrayViews() { |
| 55 AddOverviewButtonTray(); | 55 AddOverviewButtonTray(); |
| 56 AddSystemTray(); | 56 AddSystemTray(); |
| 57 AddWebNotificationTray(); | 57 AddWebNotificationTray(); |
| 58 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 59 AddLogoutButtonTray(); | 59 AddLogoutButtonTray(); |
| 60 AddVirtualKeyboardTray(); | 60 // AddVirtualKeyboardTray(); |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); | 63 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); |
| 64 DCHECK(delegate); | 64 DCHECK(delegate); |
| 65 // Initialize after all trays have been created. | 65 // Initialize after all trays have been created. |
| 66 system_tray_->InitializeTrayItems(delegate, web_notification_tray_); | 66 system_tray_->InitializeTrayItems(delegate, web_notification_tray_); |
| 67 web_notification_tray_->Initialize(); | 67 web_notification_tray_->Initialize(); |
| 68 #if defined(OS_CHROMEOS) | 68 #if defined(OS_CHROMEOS) |
| 69 logout_button_tray_->Initialize(); | 69 logout_button_tray_->Initialize(); |
| 70 virtual_keyboard_tray_->Initialize(); | 70 // virtual_keyboard_tray_->Initialize(); |
| 71 #endif | 71 #endif |
| 72 overview_button_tray_->Initialize(); | 72 overview_button_tray_->Initialize(); |
| 73 SetShelfAlignment(system_tray_->shelf_alignment()); | 73 SetShelfAlignment(system_tray_->shelf_alignment()); |
| 74 UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus()); | 74 // overview button tray ash::Shell access |
| 75 //UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus()); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void StatusAreaWidget::Shutdown() { | 78 void StatusAreaWidget::Shutdown() { |
| 78 system_tray_->Shutdown(); | 79 system_tray_->Shutdown(); |
| 79 // Destroy the trays early, causing them to be removed from the view | 80 // Destroy the trays early, causing them to be removed from the view |
| 80 // hierarchy. Do not used scoped pointers since we don't want to destroy them | 81 // hierarchy. Do not used scoped pointers since we don't want to destroy them |
| 81 // in the destructor if Shutdown() is not called (e.g. in tests). | 82 // in the destructor if Shutdown() is not called (e.g. in tests). |
| 82 delete web_notification_tray_; | 83 delete web_notification_tray_; |
| 83 web_notification_tray_ = NULL; | 84 web_notification_tray_ = NULL; |
| 84 // Must be destroyed after |web_notification_tray_|. | 85 // Must be destroyed after |web_notification_tray_|. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 114 return ((system_tray_ && system_tray_->IsAnyBubbleVisible()) || | 115 return ((system_tray_ && system_tray_->IsAnyBubbleVisible()) || |
| 115 (web_notification_tray_ && | 116 (web_notification_tray_ && |
| 116 web_notification_tray_->IsMessageCenterBubbleVisible())); | 117 web_notification_tray_->IsMessageCenterBubbleVisible())); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void StatusAreaWidget::SchedulePaint() { | 120 void StatusAreaWidget::SchedulePaint() { |
| 120 status_area_widget_delegate_->SchedulePaint(); | 121 status_area_widget_delegate_->SchedulePaint(); |
| 121 web_notification_tray_->SchedulePaint(); | 122 web_notification_tray_->SchedulePaint(); |
| 122 system_tray_->SchedulePaint(); | 123 system_tray_->SchedulePaint(); |
| 123 #if defined(OS_CHROMEOS) | 124 #if defined(OS_CHROMEOS) |
| 124 virtual_keyboard_tray_->SchedulePaint(); | 125 // virtual_keyboard_tray_->SchedulePaint(); |
| 125 logout_button_tray_->SchedulePaint(); | 126 logout_button_tray_->SchedulePaint(); |
| 126 #endif | 127 #endif |
| 127 overview_button_tray_->SchedulePaint(); | 128 overview_button_tray_->SchedulePaint(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void StatusAreaWidget::OnNativeWidgetActivationChanged(bool active) { | 131 void StatusAreaWidget::OnNativeWidgetActivationChanged(bool active) { |
| 131 Widget::OnNativeWidgetActivationChanged(active); | 132 Widget::OnNativeWidgetActivationChanged(active); |
| 132 if (active) | 133 if (active) |
| 133 status_area_widget_delegate_->SetPaneFocusAndFocusDefault(); | 134 status_area_widget_delegate_->SetPaneFocusAndFocusDefault(); |
| 134 } | 135 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 200 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
| 200 #if defined(OS_CHROMEOS) | 201 #if defined(OS_CHROMEOS) |
| 201 if (logout_button_tray_) | 202 if (logout_button_tray_) |
| 202 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); | 203 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 203 #endif | 204 #endif |
| 204 if (overview_button_tray_) | 205 if (overview_button_tray_) |
| 205 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); | 206 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 206 } | 207 } |
| 207 | 208 |
| 208 } // namespace ash | 209 } // namespace ash |
| OLD | NEW |