Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
index d21ca4cb7458845c32b69aca5d0b41d08896c5db..e950cead8c82fa834adbc686af461f0aaba7fffd 100644 |
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
@@ -19,6 +19,7 @@ |
#include "ash/shell_window_ids.h" |
#include "ash/system/bluetooth/bluetooth_observer.h" |
#include "ash/system/chromeos/session/logout_button_observer.h" |
+#include "ash/system/chromeos/shutdown_policy_observer.h" |
#include "ash/system/date/clock_observer.h" |
#include "ash/system/ime/ime_observer.h" |
#include "ash/system/tray/system_tray.h" |
@@ -232,6 +233,8 @@ SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() |
base::Unretained(this))); |
user_manager::UserManager::Get()->AddSessionStateObserver(this); |
+ shutdown_policy_handler_.reset( |
+ new ShutdownPolicyHandler(CrosSettings::Get(), this)); |
} |
void SystemTrayDelegateChromeOS::Initialize() { |
@@ -837,6 +840,21 @@ void SystemTrayDelegateChromeOS::RemoveCustodianInfoTrayObserver( |
custodian_info_changed_observers_.RemoveObserver(observer); |
} |
+void SystemTrayDelegateChromeOS::AddShutdownPolicyObserver( |
+ ash::ShutdownPolicyObserver* observer) { |
+ shutdown_policy_observers_.AddObserver(observer); |
+} |
+ |
+void SystemTrayDelegateChromeOS::RemoveShutdownPolicyObserver( |
+ ash::ShutdownPolicyObserver* observer) { |
+ shutdown_policy_observers_.RemoveObserver(observer); |
+} |
+ |
+void SystemTrayDelegateChromeOS::ShouldRebootOnShutdown( |
+ const ash::RebootOnShutdownCallback& callback) { |
+ shutdown_policy_handler_->CheckIfRebootOnShutdown(callback); |
+} |
+ |
void SystemTrayDelegateChromeOS::UserAddedToSession( |
const user_manager::User* active_user) { |
} |
@@ -1322,6 +1340,13 @@ void SystemTrayDelegateChromeOS::OnAccessibilityStatusChanged( |
OnAccessibilityModeChanged(details.notify); |
} |
+void SystemTrayDelegateChromeOS::OnShutdownPolicyChanged( |
+ bool reboot_on_shutdown) { |
+ // Notify all observers. |
+ FOR_EACH_OBSERVER(ash::ShutdownPolicyObserver, shutdown_policy_observers_, |
+ OnShutdownPolicyChanged(reboot_on_shutdown)); |
+} |
+ |
const base::string16 |
SystemTrayDelegateChromeOS::GetLegacySupervisedUserMessage() const { |
std::string user_manager_name = GetSupervisedUserManager(); |