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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 262973004: Move session length timer into tray bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 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/chromeos/session/tray_session_length_limit_unittest.cc ('k') | no next file » | 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/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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 (*it)->DestroyTrayView(); 146 (*it)->DestroyTrayView();
147 } 147 }
148 } 148 }
149 149
150 void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) { 150 void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) {
151 TrayBackgroundView::Initialize(); 151 TrayBackgroundView::Initialize();
152 CreateItems(delegate); 152 CreateItems(delegate);
153 } 153 }
154 154
155 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { 155 void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
156 #if defined(OS_CHROMEOS)
157 AddTrayItem(new TraySessionLengthLimit(this));
158 #endif
159 #if !defined(OS_WIN) 156 #if !defined(OS_WIN)
160 // Create user items for each possible user. 157 // Create user items for each possible user.
161 ash::Shell* shell = ash::Shell::GetInstance(); 158 ash::Shell* shell = ash::Shell::GetInstance();
162 int maximum_user_profiles = 159 int maximum_user_profiles =
163 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers(); 160 shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers();
164 for (int i = 0; i < maximum_user_profiles; i++) 161 for (int i = 0; i < maximum_user_profiles; i++)
165 AddTrayItem(new TrayUser(this, i)); 162 AddTrayItem(new TrayUser(this, i));
166 163
167 if (maximum_user_profiles > 1) { 164 if (maximum_user_profiles > 1) {
168 // Add a special double line separator between users and the rest of the 165 // Add a special double line separator between users and the rest of the
169 // menu if more then one user is logged in. 166 // menu if more then one user is logged in.
170 AddTrayItem(new TrayUserSeparator(this)); 167 AddTrayItem(new TrayUserSeparator(this));
171 } 168 }
172 #endif 169 #endif
173 170
174 tray_accessibility_ = new TrayAccessibility(this); 171 tray_accessibility_ = new TrayAccessibility(this);
175 tray_date_ = new TrayDate(this); 172 tray_date_ = new TrayDate(this);
176 173
177 #if defined(OS_CHROMEOS) 174 #if defined(OS_CHROMEOS)
175 AddTrayItem(new TraySessionLengthLimit(this));
178 AddTrayItem(new TrayEnterprise(this)); 176 AddTrayItem(new TrayEnterprise(this));
179 AddTrayItem(new TrayLocallyManagedUser(this)); 177 AddTrayItem(new TrayLocallyManagedUser(this));
180 AddTrayItem(new TrayIME(this)); 178 AddTrayItem(new TrayIME(this));
181 AddTrayItem(tray_accessibility_); 179 AddTrayItem(tray_accessibility_);
182 AddTrayItem(new TrayTracing(this)); 180 AddTrayItem(new TrayTracing(this));
183 AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get())); 181 AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get()));
184 AddTrayItem(new TrayNetwork(this)); 182 AddTrayItem(new TrayNetwork(this));
185 AddTrayItem(new TrayVPN(this)); 183 AddTrayItem(new TrayVPN(this));
186 AddTrayItem(new TraySms(this)); 184 AddTrayItem(new TraySms(this));
187 AddTrayItem(new TrayBluetooth(this)); 185 AddTrayItem(new TrayBluetooth(this));
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 system_bubble_.reset(); 708 system_bubble_.reset();
711 // When closing a system bubble with the alternate shelf layout, we need to 709 // When closing a system bubble with the alternate shelf layout, we need to
712 // turn off the active tinting of the shelf. 710 // turn off the active tinting of the shelf.
713 if (full_system_tray_menu_) { 711 if (full_system_tray_menu_) {
714 SetDrawBackgroundAsActive(false); 712 SetDrawBackgroundAsActive(false);
715 full_system_tray_menu_ = false; 713 full_system_tray_menu_ = false;
716 } 714 }
717 } 715 }
718 716
719 } // namespace ash 717 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/session/tray_session_length_limit_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698