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/common/system/status_area_widget.h" | 5 #include "ash/common/system/status_area_widget.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" | 9 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" |
10 #include "ash/common/system/chromeos/palette/palette_tray.h" | 10 #include "ash/common/system/chromeos/palette/palette_tray.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); | 127 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); |
128 if (logout_button_tray_) | 128 if (logout_button_tray_) |
129 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); | 129 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); |
130 if (overview_button_tray_) | 130 if (overview_button_tray_) |
131 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); | 131 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); |
132 } | 132 } |
133 | 133 |
134 bool StatusAreaWidget::ShouldShowShelf() const { | 134 bool StatusAreaWidget::ShouldShowShelf() const { |
135 if ((system_tray_ && system_tray_->ShouldShowShelf()) || | 135 if ((system_tray_ && system_tray_->ShouldShowShelf()) || |
136 (web_notification_tray_ && | 136 (web_notification_tray_ && |
137 web_notification_tray_->ShouldBlockShelfAutoHide())) | 137 web_notification_tray_->ShouldBlockShelfAutoHide())) |
James Cook
2017/01/23 17:11:01
Q: It seems a little odd that we still have this c
yiyix
2017/01/23 21:15:33
I think it's from the message bubble removal, http
| |
138 return true; | 138 return true; |
139 | 139 |
140 if (palette_tray_ && palette_tray_->ShouldBlockShelfAutoHide()) | 140 if (palette_tray_ && palette_tray_->ShouldBlockShelfAutoHide()) |
141 return true; | 141 return true; |
142 | 142 |
143 if (ime_menu_tray_ && ime_menu_tray_->ShouldBlockShelfAutoHide()) | 143 if (ime_menu_tray_ && ime_menu_tray_->ShouldBlockShelfAutoHide()) |
144 return true; | 144 return true; |
145 | 145 |
146 if (!wm_shelf_->IsVisible()) | 146 if (!wm_shelf_->IsVisible()) |
147 return false; | 147 return false; |
148 | 148 |
149 // If the shelf is currently visible, don't hide the shelf if the mouse | 149 // If the shelf is currently visible, don't hide the shelf if the mouse |
150 // is in any of the notification bubbles. | 150 // is in any of the notification bubbles. |
151 return (system_tray_ && system_tray_->IsMouseInNotificationBubble()) || | 151 return (system_tray_ && system_tray_->IsMouseInNotificationBubble()); |
James Cook
2017/01/23 17:11:01
nit: no parens
yiyix
2017/01/23 21:15:33
Done.
| |
152 (web_notification_tray_ && | |
153 web_notification_tray_->IsMouseInNotificationBubble()); | |
154 } | 152 } |
155 | 153 |
156 bool StatusAreaWidget::IsMessageBubbleShown() const { | 154 bool StatusAreaWidget::IsMessageBubbleShown() const { |
157 return ((system_tray_ && system_tray_->IsAnyBubbleVisible()) || | 155 return ((system_tray_ && system_tray_->IsAnyBubbleVisible()) || |
158 (web_notification_tray_ && | 156 (web_notification_tray_ && |
159 web_notification_tray_->IsMessageCenterBubbleVisible())); | 157 web_notification_tray_->IsMessageCenterBubbleVisible())); |
160 } | 158 } |
161 | 159 |
162 void StatusAreaWidget::SchedulePaint() { | 160 void StatusAreaWidget::SchedulePaint() { |
163 status_area_widget_delegate_->SchedulePaint(); | 161 status_area_widget_delegate_->SchedulePaint(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); | 234 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); |
237 status_area_widget_delegate_->AddTray(ime_menu_tray_); | 235 status_area_widget_delegate_->AddTray(ime_menu_tray_); |
238 } | 236 } |
239 | 237 |
240 void StatusAreaWidget::AddOverviewButtonTray() { | 238 void StatusAreaWidget::AddOverviewButtonTray() { |
241 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); | 239 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); |
242 status_area_widget_delegate_->AddTray(overview_button_tray_); | 240 status_area_widget_delegate_->AddTray(overview_button_tray_); |
243 } | 241 } |
244 | 242 |
245 } // namespace ash | 243 } // namespace ash |
OLD | NEW |