| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "ash/common/ash_switches.h" | 15 #include "ash/common/ash_switches.h" |
| 16 #include "ash/common/login_status.h" | 16 #include "ash/common/login_status.h" |
| 17 #include "ash/common/session/session_state_delegate.h" | 17 #include "ash/common/session/session_state_delegate.h" |
| 18 #include "ash/common/session/session_state_observer.h" | 18 #include "ash/common/session/session_state_observer.h" |
| 19 #include "ash/common/shell_delegate.h" |
| 19 #include "ash/common/shell_window_ids.h" | 20 #include "ash/common/shell_window_ids.h" |
| 20 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" | 21 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" |
| 21 #include "ash/common/system/chromeos/power/power_status.h" | 22 #include "ash/common/system/chromeos/power/power_status.h" |
| 22 #include "ash/common/system/chromeos/session/logout_button_observer.h" | 23 #include "ash/common/system/chromeos/session/logout_button_observer.h" |
| 23 #include "ash/common/system/chromeos/shutdown_policy_observer.h" | 24 #include "ash/common/system/chromeos/shutdown_policy_observer.h" |
| 24 #include "ash/common/system/date/clock_observer.h" | 25 #include "ash/common/system/date/clock_observer.h" |
| 25 #include "ash/common/system/ime/ime_observer.h" | 26 #include "ash/common/system/ime/ime_observer.h" |
| 26 #include "ash/common/system/tray/system_tray_delegate.h" | 27 #include "ash/common/system/tray/system_tray_delegate.h" |
| 27 #include "ash/common/system/tray/system_tray_notifier.h" | 28 #include "ash/common/system/tray/system_tray_notifier.h" |
| 28 #include "ash/common/system/tray_accessibility.h" | 29 #include "ash/common/system/tray_accessibility.h" |
| 29 #include "ash/common/system/update/update_observer.h" | 30 #include "ash/common/system/update/update_observer.h" |
| 30 #include "ash/common/system/user/user_observer.h" | 31 #include "ash/common/system/user/user_observer.h" |
| 31 #include "ash/common/system/volume_control_delegate.h" | 32 #include "ash/common/system/volume_control_delegate.h" |
| 32 #include "ash/common/wm_shell.h" | 33 #include "ash/common/wm_shell.h" |
| 33 #include "ash/desktop_background/desktop_background_controller.h" | 34 #include "ash/desktop_background/desktop_background_controller.h" |
| 34 #include "ash/shell.h" | 35 #include "ash/shell.h" |
| 35 #include "ash/shell_delegate.h" | |
| 36 #include "ash/system/tray/system_tray.h" | 36 #include "ash/system/tray/system_tray.h" |
| 37 #include "ash/wm/lock_state_controller.h" | 37 #include "ash/wm/lock_state_controller.h" |
| 38 #include "base/bind_helpers.h" | 38 #include "base/bind_helpers.h" |
| 39 #include "base/callback.h" | 39 #include "base/callback.h" |
| 40 #include "base/logging.h" | 40 #include "base/logging.h" |
| 41 #include "base/memory/ptr_util.h" | 41 #include "base/memory/ptr_util.h" |
| 42 #include "base/memory/weak_ptr.h" | 42 #include "base/memory/weak_ptr.h" |
| 43 #include "base/strings/stringprintf.h" | 43 #include "base/strings/stringprintf.h" |
| 44 #include "base/strings/utf_string_conversions.h" | 44 #include "base/strings/utf_string_conversions.h" |
| 45 #include "base/sys_info.h" | 45 #include "base/sys_info.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); | 540 help_app->ShowHelpTopic(chromeos::HelpAppLauncher::HELP_ENTERPRISE); |
| 541 } else { | 541 } else { |
| 542 chrome::ScopedTabbedBrowserDisplayer displayer( | 542 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 543 ProfileManager::GetActiveUserProfile()); | 543 ProfileManager::GetActiveUserProfile()); |
| 544 chrome::ShowSingletonTab(displayer.browser(), | 544 chrome::ShowSingletonTab(displayer.browser(), |
| 545 GURL(chrome::kLearnMoreEnterpriseURL)); | 545 GURL(chrome::kLearnMoreEnterpriseURL)); |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 | 548 |
| 549 void SystemTrayDelegateChromeOS::ShowUserLogin() { | 549 void SystemTrayDelegateChromeOS::ShowUserLogin() { |
| 550 ash::Shell* shell = ash::Shell::GetInstance(); | |
| 551 ash::WmShell* wm_shell = ash::WmShell::Get(); | 550 ash::WmShell* wm_shell = ash::WmShell::Get(); |
| 552 if (!shell->delegate()->IsMultiProfilesEnabled()) | 551 if (!wm_shell->delegate()->IsMultiProfilesEnabled()) |
| 553 return; | 552 return; |
| 554 | 553 |
| 555 // Only regular non-supervised users could add other users to current session. | 554 // Only regular non-supervised users could add other users to current session. |
| 556 if (user_manager::UserManager::Get()->GetActiveUser()->GetType() != | 555 if (user_manager::UserManager::Get()->GetActiveUser()->GetType() != |
| 557 user_manager::USER_TYPE_REGULAR) { | 556 user_manager::USER_TYPE_REGULAR) { |
| 558 return; | 557 return; |
| 559 } | 558 } |
| 560 | 559 |
| 561 if (static_cast<int>( | 560 if (static_cast<int>( |
| 562 user_manager::UserManager::Get()->GetLoggedInUsers().size()) >= | 561 user_manager::UserManager::Get()->GetLoggedInUsers().size()) >= |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1321 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1323 << "ENABLE_SUPERVISED_USERS undefined."; | 1322 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1324 return base::string16(); | 1323 return base::string16(); |
| 1325 } | 1324 } |
| 1326 | 1325 |
| 1327 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1326 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1328 return new SystemTrayDelegateChromeOS(); | 1327 return new SystemTrayDelegateChromeOS(); |
| 1329 } | 1328 } |
| 1330 | 1329 |
| 1331 } // namespace chromeos | 1330 } // namespace chromeos |
| OLD | NEW |