| 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 <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "ash/common/login_status.h" | 16 #include "ash/common/login_status.h" |
| 17 #include "ash/common/shell_delegate.h" | 17 #include "ash/common/shell_delegate.h" |
| 18 #include "ash/common/system/chromeos/power/power_status.h" | 18 #include "ash/common/system/chromeos/power/power_status.h" |
| 19 #include "ash/common/system/chromeos/session/logout_button_observer.h" | 19 #include "ash/common/system/chromeos/session/logout_button_observer.h" |
| 20 #include "ash/common/system/date/clock_observer.h" | 20 #include "ash/common/system/date/clock_observer.h" |
| 21 #include "ash/common/system/ime/ime_observer.h" | 21 #include "ash/common/system/ime/ime_observer.h" |
| 22 #include "ash/common/system/tray/system_tray_notifier.h" | 22 #include "ash/common/system/tray/system_tray_notifier.h" |
| 23 #include "ash/common/system/tray_accessibility.h" | 23 #include "ash/common/system/tray_accessibility.h" |
| 24 #include "ash/common/system/user/user_observer.h" | 24 #include "ash/common/system/user/user_observer.h" |
| 25 #include "ash/common/wm_shell.h" | |
| 26 #include "ash/shell.h" | 25 #include "ash/shell.h" |
| 27 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" | 26 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
| 28 #include "base/callback.h" | 27 #include "base/callback.h" |
| 29 #include "base/logging.h" | 28 #include "base/logging.h" |
| 30 #include "base/memory/ptr_util.h" | 29 #include "base/memory/ptr_util.h" |
| 31 #include "base/metrics/user_metrics.h" | 30 #include "base/metrics/user_metrics.h" |
| 32 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
| 33 #include "base/sys_info.h" | 32 #include "base/sys_info.h" |
| 34 #include "base/time/time.h" | 33 #include "base/time/time.h" |
| 35 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 user_manager::User* user) { | 458 user_manager::User* user) { |
| 460 Profile* user_profile = ProfileHelper::Get()->GetProfileByUser(user); | 459 Profile* user_profile = ProfileHelper::Get()->GetProfileByUser(user); |
| 461 | 460 |
| 462 // Returned user_profile might be NULL on restoring Users on browser start. | 461 // Returned user_profile might be NULL on restoring Users on browser start. |
| 463 // At some point profile is not yet fully initiated. | 462 // At some point profile is not yet fully initiated. |
| 464 if (session_started_ && user_profile && user_profile_ == user_profile) | 463 if (session_started_ && user_profile && user_profile_ == user_profile) |
| 465 ash::Shell::Get()->UpdateAfterLoginStatusChange(GetUserLoginStatus()); | 464 ash::Shell::Get()->UpdateAfterLoginStatusChange(GetUserLoginStatus()); |
| 466 } | 465 } |
| 467 | 466 |
| 468 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { | 467 ash::SystemTrayNotifier* SystemTrayDelegateChromeOS::GetSystemTrayNotifier() { |
| 469 return ash::WmShell::Get()->system_tray_notifier(); | 468 return ash::Shell::Get()->system_tray_notifier(); |
| 470 } | 469 } |
| 471 | 470 |
| 472 void SystemTrayDelegateChromeOS::SetProfile(Profile* profile) { | 471 void SystemTrayDelegateChromeOS::SetProfile(Profile* profile) { |
| 473 // Stop observing the AppWindowRegistry of the current |user_profile_|. | 472 // Stop observing the AppWindowRegistry of the current |user_profile_|. |
| 474 StopObservingAppWindowRegistry(); | 473 StopObservingAppWindowRegistry(); |
| 475 | 474 |
| 476 // Stop observing custodian info changes of the current |user_profile_|. | 475 // Stop observing custodian info changes of the current |user_profile_|. |
| 477 StopObservingCustodianInfoChanges(); | 476 StopObservingCustodianInfoChanges(); |
| 478 | 477 |
| 479 user_profile_ = profile; | 478 user_profile_ = profile; |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 790 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 792 << "ENABLE_SUPERVISED_USERS undefined."; | 791 << "ENABLE_SUPERVISED_USERS undefined."; |
| 793 return base::string16(); | 792 return base::string16(); |
| 794 } | 793 } |
| 795 | 794 |
| 796 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 795 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 797 return new SystemTrayDelegateChromeOS(); | 796 return new SystemTrayDelegateChromeOS(); |
| 798 } | 797 } |
| 799 | 798 |
| 800 } // namespace chromeos | 799 } // namespace chromeos |
| OLD | NEW |