| 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" | |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 7 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shelf/shelf_widget.h" | 8 #include "ash/shelf/shelf_widget.h" |
| 10 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 11 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| 12 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 13 #include "ash/system/overview/overview_button_tray.h" | 12 #include "ash/system/overview/overview_button_tray.h" |
| 14 #include "ash/system/status_area_widget_delegate.h" | 13 #include "ash/system/status_area_widget_delegate.h" |
| 15 #include "ash/system/tray/system_tray.h" | 14 #include "ash/system/tray/system_tray.h" |
| 16 #include "ash/system/tray/system_tray_delegate.h" | 15 #include "ash/system/tray/system_tray_delegate.h" |
| 17 #include "ash/system/web_notification/web_notification_tray.h" | 16 #include "ash/system/web_notification/web_notification_tray.h" |
| 17 #include "ash/wm/common/wm_root_window_controller.h" |
| 18 #include "ash/wm/common/wm_window.h" |
| 18 #include "ash/wm/window_properties.h" | 19 #include "ash/wm/window_properties.h" |
| 19 #include "base/i18n/time_formatting.h" | 20 #include "base/i18n/time_formatting.h" |
| 20 #include "ui/aura/window.h" | |
| 21 | 21 |
| 22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 23 #include "ash/system/chromeos/session/logout_button_tray.h" | 23 #include "ash/system/chromeos/session/logout_button_tray.h" |
| 24 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" | 24 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 | 28 |
| 29 StatusAreaWidget::StatusAreaWidget(aura::Window* status_container, | 29 StatusAreaWidget::StatusAreaWidget(wm::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_(user::LOGGED_IN_NONE), |
| 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.parent = status_container; | |
| 46 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 45 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 46 status_container->GetRootWindowController() |
| 47 ->ConfigureWidgetInitParamsForContainer( |
| 48 this, status_container->GetShellWindowId(), ¶ms); |
| 47 Init(params); | 49 Init(params); |
| 48 set_focus_on_creation(false); | 50 set_focus_on_creation(false); |
| 49 SetContentsView(status_area_widget_delegate_); | 51 SetContentsView(status_area_widget_delegate_); |
| 50 } | 52 } |
| 51 | 53 |
| 52 StatusAreaWidget::~StatusAreaWidget() { | 54 StatusAreaWidget::~StatusAreaWidget() { |
| 53 } | 55 } |
| 54 | 56 |
| 55 void StatusAreaWidget::CreateTrayViews() { | 57 void StatusAreaWidget::CreateTrayViews() { |
| 56 AddOverviewButtonTray(); | 58 AddOverviewButtonTray(); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 207 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
| 206 #if defined(OS_CHROMEOS) | 208 #if defined(OS_CHROMEOS) |
| 207 if (logout_button_tray_) | 209 if (logout_button_tray_) |
| 208 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); | 210 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 209 #endif | 211 #endif |
| 210 if (overview_button_tray_) | 212 if (overview_button_tray_) |
| 211 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); | 213 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); |
| 212 } | 214 } |
| 213 | 215 |
| 214 } // namespace ash | 216 } // namespace ash |
| OLD | NEW |