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/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
8 #include "ash/common/wm_root_window_controller.h" | 8 #include "ash/common/wm_root_window_controller.h" |
9 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 StatusAreaWidget::StatusAreaWidget(WmWindow* status_container, | 29 StatusAreaWidget::StatusAreaWidget(WmWindow* status_container, |
30 ShelfWidget* shelf_widget) | 30 ShelfWidget* shelf_widget) |
31 : status_area_widget_delegate_(new StatusAreaWidgetDelegate), | 31 : status_area_widget_delegate_(new StatusAreaWidgetDelegate), |
32 overview_button_tray_(NULL), | 32 overview_button_tray_(NULL), |
33 system_tray_(NULL), | 33 system_tray_(NULL), |
34 web_notification_tray_(NULL), | 34 web_notification_tray_(NULL), |
35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
36 logout_button_tray_(NULL), | 36 logout_button_tray_(NULL), |
37 virtual_keyboard_tray_(NULL), | 37 virtual_keyboard_tray_(NULL), |
38 #endif | 38 #endif |
39 login_status_(user::LOGGED_IN_NONE), | 39 login_status_(LoginStatus::NOT_LOGGED_IN), |
40 shelf_widget_(shelf_widget) { | 40 shelf_widget_(shelf_widget) { |
41 views::Widget::InitParams params( | 41 views::Widget::InitParams params( |
42 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 42 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
43 params.delegate = status_area_widget_delegate_; | 43 params.delegate = status_area_widget_delegate_; |
44 params.name = "StatusAreaWidget"; | 44 params.name = "StatusAreaWidget"; |
45 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 45 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
46 status_container->GetRootWindowController() | 46 status_container->GetRootWindowController() |
47 ->ConfigureWidgetInitParamsForContainer( | 47 ->ConfigureWidgetInitParamsForContainer( |
48 this, status_container->GetShellWindowId(), ¶ms); | 48 this, status_container->GetShellWindowId(), ¶ms); |
49 Init(params); | 49 Init(params); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (overview_button_tray_) | 189 if (overview_button_tray_) |
190 overview_button_tray_->SetShelfAlignment(alignment); | 190 overview_button_tray_->SetShelfAlignment(alignment); |
191 status_area_widget_delegate_->UpdateLayout(); | 191 status_area_widget_delegate_->UpdateLayout(); |
192 } | 192 } |
193 | 193 |
194 void StatusAreaWidget::SetHideSystemNotifications(bool hide) { | 194 void StatusAreaWidget::SetHideSystemNotifications(bool hide) { |
195 if (system_tray_) | 195 if (system_tray_) |
196 system_tray_->SetHideNotifications(hide); | 196 system_tray_->SetHideNotifications(hide); |
197 } | 197 } |
198 | 198 |
199 void StatusAreaWidget::UpdateAfterLoginStatusChange( | 199 void StatusAreaWidget::UpdateAfterLoginStatusChange(LoginStatus login_status) { |
200 user::LoginStatus login_status) { | |
201 if (login_status_ == login_status) | 200 if (login_status_ == login_status) |
202 return; | 201 return; |
203 login_status_ = login_status; | 202 login_status_ = login_status; |
204 if (system_tray_) | 203 if (system_tray_) |
205 system_tray_->UpdateAfterLoginStatusChange(login_status); | 204 system_tray_->UpdateAfterLoginStatusChange(login_status); |
206 if (web_notification_tray_) | 205 if (web_notification_tray_) |
207 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 206 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
208 #if defined(OS_CHROMEOS) | 207 #if defined(OS_CHROMEOS) |
209 if (logout_button_tray_) | 208 if (logout_button_tray_) |
210 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); | 209 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); |
211 #endif | 210 #endif |
212 if (overview_button_tray_) | 211 if (overview_button_tray_) |
213 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); | 212 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); |
214 } | 213 } |
215 | 214 |
216 } // namespace ash | 215 } // namespace ash |
OLD | NEW |