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/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/metrics/user_metrics_recorder.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 (*it)->DestroyTrayView(); | 145 (*it)->DestroyTrayView(); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) { | 149 void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) { |
150 TrayBackgroundView::Initialize(); | 150 TrayBackgroundView::Initialize(); |
151 CreateItems(delegate); | 151 CreateItems(delegate); |
152 } | 152 } |
153 | 153 |
154 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { | 154 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { |
155 #if defined(OS_CHROMEOS) | |
156 AddTrayItem(new TraySessionLengthLimit(this)); | |
157 #endif | |
158 #if !defined(OS_WIN) | 155 #if !defined(OS_WIN) |
159 // Create user items for each possible user. | 156 // Create user items for each possible user. |
160 ash::Shell* shell = ash::Shell::GetInstance(); | 157 ash::Shell* shell = ash::Shell::GetInstance(); |
161 int maximum_user_profiles = | 158 int maximum_user_profiles = |
162 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers(); | 159 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers(); |
163 for (int i = 0; i < maximum_user_profiles; i++) | 160 for (int i = 0; i < maximum_user_profiles; i++) |
164 AddTrayItem(new TrayUser(this, i)); | 161 AddTrayItem(new TrayUser(this, i)); |
165 | 162 |
166 if (maximum_user_profiles > 1) { | 163 if (maximum_user_profiles > 1) { |
167 // Add a special double line separator between users and the rest of the | 164 // Add a special double line separator between users and the rest of the |
168 // menu if more then one user is logged in. | 165 // menu if more then one user is logged in. |
169 AddTrayItem(new TrayUserSeparator(this)); | 166 AddTrayItem(new TrayUserSeparator(this)); |
170 } | 167 } |
171 #endif | 168 #endif |
172 | 169 |
173 tray_accessibility_ = new TrayAccessibility(this); | 170 tray_accessibility_ = new TrayAccessibility(this); |
174 tray_date_ = new TrayDate(this); | 171 tray_date_ = new TrayDate(this); |
175 | 172 |
176 #if defined(OS_CHROMEOS) | 173 #if defined(OS_CHROMEOS) |
174 AddTrayItem(new TraySessionLengthLimit(this)); | |
stevenjb
2014/05/02 19:40:02
I assume that placing the session length limit tra
Thiemo Nagel
2014/05/02 20:05:19
Yes, it is.
| |
177 AddTrayItem(new TrayEnterprise(this)); | 175 AddTrayItem(new TrayEnterprise(this)); |
178 AddTrayItem(new TrayLocallyManagedUser(this)); | 176 AddTrayItem(new TrayLocallyManagedUser(this)); |
179 AddTrayItem(new TrayIME(this)); | 177 AddTrayItem(new TrayIME(this)); |
180 AddTrayItem(tray_accessibility_); | 178 AddTrayItem(tray_accessibility_); |
181 AddTrayItem(new TrayTracing(this)); | 179 AddTrayItem(new TrayTracing(this)); |
182 AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get())); | 180 AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get())); |
183 AddTrayItem(new TrayNetwork(this)); | 181 AddTrayItem(new TrayNetwork(this)); |
184 AddTrayItem(new TrayVPN(this)); | 182 AddTrayItem(new TrayVPN(this)); |
185 AddTrayItem(new TraySms(this)); | 183 AddTrayItem(new TraySms(this)); |
186 AddTrayItem(new TrayBluetooth(this)); | 184 AddTrayItem(new TrayBluetooth(this)); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
708 system_bubble_.reset(); | 706 system_bubble_.reset(); |
709 // When closing a system bubble with the alternate shelf layout, we need to | 707 // When closing a system bubble with the alternate shelf layout, we need to |
710 // turn off the active tinting of the shelf. | 708 // turn off the active tinting of the shelf. |
711 if (full_system_tray_menu_) { | 709 if (full_system_tray_menu_) { |
712 SetDrawBackgroundAsActive(false); | 710 SetDrawBackgroundAsActive(false); |
713 full_system_tray_menu_ = false; | 711 full_system_tray_menu_ = false; |
714 } | 712 } |
715 } | 713 } |
716 | 714 |
717 } // namespace ash | 715 } // namespace ash |
OLD | NEW |