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

Side by Side Diff: ash/system/status_area_widget.cc

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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/system/tray/system_tray_delegate.h" 8 #include "ash/common/system/tray/system_tray_delegate.h"
9 #include "ash/common/wm_root_window_controller.h" 9 #include "ash/common/wm_root_window_controller.h"
10 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 11 #include "ash/common/wm_window.h"
11 #include "ash/shelf/shelf_layout_manager.h" 12 #include "ash/shelf/shelf_layout_manager.h"
12 #include "ash/shelf/shelf_widget.h" 13 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h" 14 #include "ash/shell.h"
14 #include "ash/shell_delegate.h" 15 #include "ash/shell_delegate.h"
15 #include "ash/system/overview/overview_button_tray.h" 16 #include "ash/system/overview/overview_button_tray.h"
16 #include "ash/system/status_area_widget_delegate.h" 17 #include "ash/system/status_area_widget_delegate.h"
17 #include "ash/system/tray/system_tray.h" 18 #include "ash/system/tray/system_tray.h"
18 #include "ash/system/web_notification/web_notification_tray.h" 19 #include "ash/system/web_notification/web_notification_tray.h"
19 #include "ash/wm/window_properties.h" 20 #include "ash/wm/window_properties.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 57
57 void StatusAreaWidget::CreateTrayViews() { 58 void StatusAreaWidget::CreateTrayViews() {
58 AddOverviewButtonTray(); 59 AddOverviewButtonTray();
59 AddSystemTray(); 60 AddSystemTray();
60 AddWebNotificationTray(); 61 AddWebNotificationTray();
61 #if defined(OS_CHROMEOS) 62 #if defined(OS_CHROMEOS)
62 AddLogoutButtonTray(); 63 AddLogoutButtonTray();
63 AddVirtualKeyboardTray(); 64 AddVirtualKeyboardTray();
64 #endif 65 #endif
65 66
66 SystemTrayDelegate* delegate = 67 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
67 ash::Shell::GetInstance()->system_tray_delegate();
68 DCHECK(delegate); 68 DCHECK(delegate);
69 // Initialize after all trays have been created. 69 // Initialize after all trays have been created.
70 system_tray_->InitializeTrayItems(delegate); 70 system_tray_->InitializeTrayItems(delegate);
71 web_notification_tray_->Initialize(); 71 web_notification_tray_->Initialize();
72 #if defined(OS_CHROMEOS) 72 #if defined(OS_CHROMEOS)
73 logout_button_tray_->Initialize(); 73 logout_button_tray_->Initialize();
74 virtual_keyboard_tray_->Initialize(); 74 virtual_keyboard_tray_->Initialize();
75 #endif 75 #endif
76 overview_button_tray_->Initialize(); 76 overview_button_tray_->Initialize();
77 SetShelfAlignment(system_tray_->shelf_alignment()); 77 SetShelfAlignment(system_tray_->shelf_alignment());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); 206 web_notification_tray_->UpdateAfterLoginStatusChange(login_status);
207 #if defined(OS_CHROMEOS) 207 #if defined(OS_CHROMEOS)
208 if (logout_button_tray_) 208 if (logout_button_tray_)
209 logout_button_tray_->UpdateAfterLoginStatusChange(login_status); 209 logout_button_tray_->UpdateAfterLoginStatusChange(login_status);
210 #endif 210 #endif
211 if (overview_button_tray_) 211 if (overview_button_tray_)
212 overview_button_tray_->UpdateAfterLoginStatusChange(login_status); 212 overview_button_tray_->UpdateAfterLoginStatusChange(login_status);
213 } 213 }
214 214
215 } // namespace ash 215 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698