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

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

Issue 2864663002: cros: Merge SystemTrayDelegate::GetUserLoginStatus (Closed)
Patch Set: update PaletteTray to exclude ARC kiosk Created 3 years, 7 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
« no previous file with comments | « ash/system/session/logout_confirmation_controller.cc ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/session/session_controller.h"
9 #include "ash/shelf/wm_shelf.h" 10 #include "ash/shelf/wm_shelf.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/system/ime_menu/ime_menu_tray.h" 12 #include "ash/system/ime_menu/ime_menu_tray.h"
12 #include "ash/system/overview/overview_button_tray.h" 13 #include "ash/system/overview/overview_button_tray.h"
13 #include "ash/system/palette/palette_tray.h" 14 #include "ash/system/palette/palette_tray.h"
14 #include "ash/system/palette/palette_utils.h" 15 #include "ash/system/palette/palette_utils.h"
15 #include "ash/system/session/logout_button_tray.h" 16 #include "ash/system/session/logout_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/tray/system_tray_delegate.h" 19 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 DCHECK(delegate); 66 DCHECK(delegate);
66 // Initialize after all trays have been created. 67 // Initialize after all trays have been created.
67 system_tray_->InitializeTrayItems(delegate, web_notification_tray_); 68 system_tray_->InitializeTrayItems(delegate, web_notification_tray_);
68 web_notification_tray_->Initialize(); 69 web_notification_tray_->Initialize();
69 if (palette_tray_) 70 if (palette_tray_)
70 palette_tray_->Initialize(); 71 palette_tray_->Initialize();
71 virtual_keyboard_tray_->Initialize(); 72 virtual_keyboard_tray_->Initialize();
72 ime_menu_tray_->Initialize(); 73 ime_menu_tray_->Initialize();
73 overview_button_tray_->Initialize(); 74 overview_button_tray_->Initialize();
74 UpdateAfterShelfAlignmentChange(); 75 UpdateAfterShelfAlignmentChange();
75 UpdateAfterLoginStatusChange(delegate->GetUserLoginStatus()); 76 UpdateAfterLoginStatusChange(
77 Shell::Get()->session_controller()->login_status());
76 } 78 }
77 79
78 void StatusAreaWidget::Shutdown() { 80 void StatusAreaWidget::Shutdown() {
79 system_tray_->Shutdown(); 81 system_tray_->Shutdown();
80 // Destroy the trays early, causing them to be removed from the view 82 // Destroy the trays early, causing them to be removed from the view
81 // hierarchy. Do not used scoped pointers since we don't want to destroy them 83 // hierarchy. Do not used scoped pointers since we don't want to destroy them
82 // in the destructor if Shutdown() is not called (e.g. in tests). 84 // in the destructor if Shutdown() is not called (e.g. in tests).
83 // Failure to remove the tray views causes layout crashes during shutdown, 85 // Failure to remove the tray views causes layout crashes during shutdown,
84 // for example http://crbug.com/700122. 86 // for example http://crbug.com/700122.
85 // TODO(jamescook): Find a better way to avoid the layout problems, fix the 87 // TODO(jamescook): Find a better way to avoid the layout problems, fix the
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 ime_menu_tray_ = new ImeMenuTray(wm_shelf_); 219 ime_menu_tray_ = new ImeMenuTray(wm_shelf_);
218 status_area_widget_delegate_->AddTray(ime_menu_tray_); 220 status_area_widget_delegate_->AddTray(ime_menu_tray_);
219 } 221 }
220 222
221 void StatusAreaWidget::AddOverviewButtonTray() { 223 void StatusAreaWidget::AddOverviewButtonTray() {
222 overview_button_tray_ = new OverviewButtonTray(wm_shelf_); 224 overview_button_tray_ = new OverviewButtonTray(wm_shelf_);
223 status_area_widget_delegate_->AddTray(overview_button_tray_); 225 status_area_widget_delegate_->AddTray(overview_button_tray_);
224 } 226 }
225 227
226 } // namespace ash 228 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/session/logout_confirmation_controller.cc ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698