| 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/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/login_status.h" | 8 #include "ash/common/login_status.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 CreateItems(delegate); | 158 CreateItems(delegate); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void SystemTray::Shutdown() { | 161 void SystemTray::Shutdown() { |
| 162 DCHECK(web_notification_tray_); | 162 DCHECK(web_notification_tray_); |
| 163 web_notification_tray_ = nullptr; | 163 web_notification_tray_ = nullptr; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { | 166 void SystemTray::CreateItems(SystemTrayDelegate* delegate) { |
| 167 WmShell* wm_shell = WmShell::Get(); | 167 WmShell* wm_shell = WmShell::Get(); |
| 168 #if !defined(OS_WIN) | 168 // #if !defined(OS_WIN) |
| 169 // Create user items for each possible user. | 169 // // Create user items for each possible user. |
| 170 int maximum_user_profiles = | 170 // int maximum_user_profiles = |
| 171 wm_shell->GetSessionStateDelegate()->GetMaximumNumberOfLoggedInUsers(); | 171 // wm_shell->GetSessionStateDelegate()->GetMaximumNumberOfLoggedInUsers(); |
| 172 for (int i = 0; i < maximum_user_profiles; i++) | 172 // for (int i = 0; i < maximum_user_profiles; i++) |
| 173 AddTrayItem(new TrayUser(this, i)); | 173 // AddTrayItem(new TrayUser(this, i)); |
| 174 | 174 |
| 175 if (maximum_user_profiles > 1) { | 175 // if (maximum_user_profiles > 1) { |
| 176 // Add a special double line separator between users and the rest of the | 176 // // Add a special double line separator between users and the rest of the |
| 177 // menu if more then one user is logged in. | 177 // // menu if more then one user is logged in. |
| 178 AddTrayItem(new TrayUserSeparator(this)); | 178 // AddTrayItem(new TrayUserSeparator(this)); |
| 179 } | 179 // } |
| 180 #endif | 180 // #endif |
| 181 | 181 |
| 182 tray_accessibility_ = new TrayAccessibility(this); | 182 tray_accessibility_ = new TrayAccessibility(this); |
| 183 tray_date_ = new TrayDate(this); | 183 tray_date_ = new TrayDate(this); |
| 184 tray_update_ = new TrayUpdate(this); | 184 tray_update_ = new TrayUpdate(this); |
| 185 | 185 |
| 186 #if defined(OS_CHROMEOS) | 186 #if defined(OS_CHROMEOS) |
| 187 AddTrayItem(new TraySessionLengthLimit(this)); | 187 AddTrayItem(new TraySessionLengthLimit(this)); |
| 188 AddTrayItem(new TrayEnterprise(this)); | 188 AddTrayItem(new TrayEnterprise(this)); |
| 189 AddTrayItem(new TraySupervisedUser(this)); | 189 AddTrayItem(new TraySupervisedUser(this)); |
| 190 AddTrayItem(new TrayIME(this)); | 190 AddTrayItem(new TrayIME(this)); |
| 191 AddTrayItem(tray_accessibility_); | 191 AddTrayItem(tray_accessibility_); |
| 192 AddTrayItem(new TrayTracing(this)); | 192 AddTrayItem(new TrayTracing(this)); |
| 193 AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get())); | 193 //JAMES |
| 194 //Check failed: g_power_status. PowerStatus::Get() called before Initialize(). |
| 195 // AddTrayItem(new TrayPower(this, message_center::MessageCenter::Get())); |
| 194 AddTrayItem(new TrayNetwork(this)); | 196 AddTrayItem(new TrayNetwork(this)); |
| 195 AddTrayItem(new TrayVPN(this)); | 197 AddTrayItem(new TrayVPN(this)); |
| 196 AddTrayItem(new TraySms(this)); | 198 AddTrayItem(new TraySms(this)); |
| 197 AddTrayItem(new TrayBluetooth(this)); | 199 AddTrayItem(new TrayBluetooth(this)); |
| 198 tray_cast_ = new TrayCast(this); | 200 tray_cast_ = new TrayCast(this); |
| 199 AddTrayItem(tray_cast_); | 201 AddTrayItem(tray_cast_); |
| 200 AddTrayItem(new TrayDisplay(this)); | 202 //JAMES uses ash::Shell |
| 203 // AddTrayItem(new TrayDisplay(this)); |
| 201 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); | 204 screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); |
| 202 AddTrayItem(screen_capture_tray_item_); | 205 AddTrayItem(screen_capture_tray_item_); |
| 203 screen_share_tray_item_ = new ScreenShareTrayItem(this); | 206 screen_share_tray_item_ = new ScreenShareTrayItem(this); |
| 204 AddTrayItem(screen_share_tray_item_); | 207 AddTrayItem(screen_share_tray_item_); |
| 205 AddTrayItem(new MultiProfileMediaTrayItem(this)); | 208 //JAMES crash in OnMediaCaptureChanged |
| 209 // AddTrayItem(new MultiProfileMediaTrayItem(this)); |
| 206 AddTrayItem(new TrayAudioChromeOs(this)); | 210 AddTrayItem(new TrayAudioChromeOs(this)); |
| 207 AddTrayItem(new TrayBrightness(this)); | 211 //JAMES uses ash::Shell |
| 212 // AddTrayItem(new TrayBrightness(this)); |
| 208 AddTrayItem(new TrayCapsLock(this)); | 213 AddTrayItem(new TrayCapsLock(this)); |
| 209 AddTrayItem(new TrayRotationLock(this)); | 214 AddTrayItem(new TrayRotationLock(this)); |
| 210 AddTrayItem(new TraySettings(this)); | 215 AddTrayItem(new TraySettings(this)); |
| 211 AddTrayItem(tray_update_); | 216 AddTrayItem(tray_update_); |
| 212 AddTrayItem(tray_date_); | 217 AddTrayItem(tray_date_); |
| 213 #elif defined(OS_WIN) | 218 #elif defined(OS_WIN) |
| 214 AddTrayItem(tray_accessibility_); | 219 AddTrayItem(tray_accessibility_); |
| 215 AddTrayItem(tray_update_); | 220 AddTrayItem(tray_update_); |
| 216 AddTrayItem(tray_date_); | 221 AddTrayItem(tray_date_); |
| 217 #endif | 222 #endif |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 .work_area() | 768 .work_area() |
| 764 .height(); | 769 .height(); |
| 765 if (work_area_height > 0) { | 770 if (work_area_height > 0) { |
| 766 UMA_HISTOGRAM_CUSTOM_COUNTS( | 771 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 767 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", | 772 "Ash.SystemMenu.PercentageOfWorkAreaHeightCoveredByMenu", |
| 768 100 * bubble_view->height() / work_area_height, 1, 300, 100); | 773 100 * bubble_view->height() / work_area_height, 1, 300, 100); |
| 769 } | 774 } |
| 770 } | 775 } |
| 771 | 776 |
| 772 } // namespace ash | 777 } // namespace ash |
| OLD | NEW |