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" |
| 9 #include "ash/shelf/shelf_widget.h" |
8 #include "ash/shell.h" | 10 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.h" |
10 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.h" |
11 #include "ash/system/bluetooth/bluetooth_observer.h" | 13 #include "ash/system/bluetooth/bluetooth_observer.h" |
12 #include "ash/system/status_area_widget_delegate.h" | 14 #include "ash/system/status_area_widget_delegate.h" |
13 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
14 #include "ash/system/tray/system_tray_delegate.h" | 16 #include "ash/system/tray/system_tray_delegate.h" |
15 #include "ash/system/web_notification/web_notification_tray.h" | 17 #include "ash/system/web_notification/web_notification_tray.h" |
16 #include "ash/wm/shelf_layout_manager.h" | |
17 #include "ash/wm/window_properties.h" | 18 #include "ash/wm/window_properties.h" |
18 #include "base/i18n/time_formatting.h" | 19 #include "base/i18n/time_formatting.h" |
19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
20 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
21 | 22 |
22 namespace ash { | 23 namespace ash { |
23 | 24 |
24 namespace internal { | 25 namespace internal { |
25 | 26 |
26 StatusAreaWidget::StatusAreaWidget(aura::Window* status_container) | 27 StatusAreaWidget::StatusAreaWidget(aura::Window* status_container) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 102 |
102 void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { | 103 void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { |
103 status_area_widget_delegate_->set_alignment(alignment); | 104 status_area_widget_delegate_->set_alignment(alignment); |
104 if (system_tray_) | 105 if (system_tray_) |
105 system_tray_->SetShelfAlignment(alignment); | 106 system_tray_->SetShelfAlignment(alignment); |
106 if (web_notification_tray_) | 107 if (web_notification_tray_) |
107 web_notification_tray_->SetShelfAlignment(alignment); | 108 web_notification_tray_->SetShelfAlignment(alignment); |
108 status_area_widget_delegate_->UpdateLayout(); | 109 status_area_widget_delegate_->UpdateLayout(); |
109 } | 110 } |
110 | 111 |
111 void StatusAreaWidget::SetPaintsBackground( | |
112 bool value, | |
113 internal::BackgroundAnimator::ChangeType change_type) { | |
114 if (system_tray_) | |
115 system_tray_->SetPaintsBackground(value, change_type); | |
116 if (web_notification_tray_) | |
117 web_notification_tray_->SetPaintsBackground(value, change_type); | |
118 } | |
119 | |
120 void StatusAreaWidget::SetHideWebNotifications(bool hide) { | 112 void StatusAreaWidget::SetHideWebNotifications(bool hide) { |
121 if (web_notification_tray_) | 113 if (web_notification_tray_) |
122 web_notification_tray_->SetHidePopupBubble(hide); | 114 web_notification_tray_->SetHidePopupBubble(hide); |
123 } | 115 } |
124 | 116 |
125 void StatusAreaWidget::SetHideSystemNotifications(bool hide) { | 117 void StatusAreaWidget::SetHideSystemNotifications(bool hide) { |
126 if (system_tray_) | 118 if (system_tray_) |
127 system_tray_->SetHideNotifications(hide); | 119 system_tray_->SetHideNotifications(hide); |
128 } | 120 } |
129 | 121 |
130 bool StatusAreaWidget::ShouldShowWebNotifications() { | 122 bool StatusAreaWidget::ShouldShowWebNotifications() { |
131 return !(system_tray_ && system_tray_->IsAnyBubbleVisible()); | 123 return !(system_tray_ && system_tray_->IsAnyBubbleVisible()); |
132 } | 124 } |
133 | 125 |
134 void StatusAreaWidget::UpdateAfterLoginStatusChange( | 126 void StatusAreaWidget::UpdateAfterLoginStatusChange( |
135 user::LoginStatus login_status) { | 127 user::LoginStatus login_status) { |
136 if (login_status_ == login_status) | 128 if (login_status_ == login_status) |
137 return; | 129 return; |
138 login_status_ = login_status; | 130 login_status_ = login_status; |
139 if (system_tray_) | 131 if (system_tray_) |
140 system_tray_->UpdateAfterLoginStatusChange(login_status); | 132 system_tray_->UpdateAfterLoginStatusChange(login_status); |
141 if (web_notification_tray_) | 133 if (web_notification_tray_) |
142 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 134 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
143 } | 135 } |
144 | 136 |
145 } // namespace internal | 137 } // namespace internal |
146 } // namespace ash | 138 } // namespace ash |
OLD | NEW |