Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: ash/system/status_area_widget.cc

Issue 2807693002: Make LogoutButtonTray a regular View (Closed)
Patch Set: Rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/status_area_widget.cc
diff --git a/ash/system/status_area_widget.cc b/ash/system/status_area_widget.cc
index ed36c78706ac665944c4a4e2e3abdc81860f54c5..672f307acf1f14cb7983a2fcb61ea8e90f2d9a6b 100644
--- a/ash/system/status_area_widget.cc
+++ b/ash/system/status_area_widget.cc
@@ -28,7 +28,7 @@ namespace ash {
StatusAreaWidget::StatusAreaWidget(WmWindow* status_container,
WmShelf* wm_shelf)
- : status_area_widget_delegate_(new StatusAreaWidgetDelegate),
+ : status_area_widget_delegate_(new StatusAreaWidgetDelegate(wm_shelf)),
overview_button_tray_(nullptr),
system_tray_(nullptr),
web_notification_tray_(nullptr),
@@ -67,13 +67,12 @@ void StatusAreaWidget::CreateTrayViews() {
// Initialize after all trays have been created.
system_tray_->InitializeTrayItems(delegate, web_notification_tray_);
web_notification_tray_->Initialize();
- logout_button_tray_->Initialize();
if (palette_tray_)
palette_tray_->Initialize();
virtual_keyboard_tray_->Initialize();
ime_menu_tray_->Initialize();
overview_button_tray_->Initialize();
- SetShelfAlignment(system_tray_->shelf_alignment());
+ UpdateAfterShelfAlignmentChange();
UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus());
}
@@ -105,22 +104,21 @@ void StatusAreaWidget::Shutdown() {
DCHECK_EQ(0, GetContentsView()->child_count());
}
-void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
- status_area_widget_delegate_->set_alignment(alignment);
+void StatusAreaWidget::UpdateAfterShelfAlignmentChange() {
if (system_tray_)
- system_tray_->SetShelfAlignment(alignment);
+ system_tray_->UpdateAfterShelfAlignmentChange();
if (web_notification_tray_)
- web_notification_tray_->SetShelfAlignment(alignment);
+ web_notification_tray_->UpdateAfterShelfAlignmentChange();
if (logout_button_tray_)
- logout_button_tray_->SetShelfAlignment(alignment);
+ logout_button_tray_->UpdateAfterShelfAlignmentChange();
if (virtual_keyboard_tray_)
- virtual_keyboard_tray_->SetShelfAlignment(alignment);
+ virtual_keyboard_tray_->UpdateAfterShelfAlignmentChange();
if (ime_menu_tray_)
- ime_menu_tray_->SetShelfAlignment(alignment);
+ ime_menu_tray_->UpdateAfterShelfAlignmentChange();
if (palette_tray_)
- palette_tray_->SetShelfAlignment(alignment);
+ palette_tray_->UpdateAfterShelfAlignmentChange();
if (overview_button_tray_)
- overview_button_tray_->SetShelfAlignment(alignment);
+ overview_button_tray_->UpdateAfterShelfAlignmentChange();
status_area_widget_delegate_->UpdateLayout();
}
@@ -133,7 +131,7 @@ void StatusAreaWidget::UpdateAfterLoginStatusChange(LoginStatus login_status) {
if (web_notification_tray_)
web_notification_tray_->UpdateAfterLoginStatusChange(login_status);
if (logout_button_tray_)
- logout_button_tray_->UpdateAfterLoginStatusChange(login_status);
+ logout_button_tray_->UpdateAfterLoginStatusChange();
if (overview_button_tray_)
overview_button_tray_->UpdateAfterLoginStatusChange(login_status);
}
@@ -187,7 +185,6 @@ void StatusAreaWidget::UpdateShelfItemBackground(SkColor color) {
web_notification_tray_->UpdateShelfItemBackground(color);
system_tray_->UpdateShelfItemBackground(color);
virtual_keyboard_tray_->UpdateShelfItemBackground(color);
- logout_button_tray_->UpdateShelfItemBackground(color);
ime_menu_tray_->UpdateShelfItemBackground(color);
if (palette_tray_)
palette_tray_->UpdateShelfItemBackground(color);

Powered by Google App Engine
This is Rietveld 408576698