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

Unified Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.h

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shutdown_allowed => reboot_on_shutdown Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.h
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.h b/chrome/browser/ui/ash/system_tray_delegate_chromeos.h
index a5aeaa14c97335a5706c406d4223b6e8e897b20f..97088da85e9f4e797858ac60525a320672f51ef0 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.h
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.h
@@ -24,6 +24,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/supervised_user/supervised_user_service_observer.h"
#include "chrome/browser/ui/browser_list_observer.h"
+#include "chrome/browser/ui/webui/chromeos/login/shutdown_policy_observer.h"
Daniel Erat 2014/12/17 16:21:04 it seems strange to me for this file to depend on
stevenjb 2014/12/17 19:09:03 +1. shutdown_policy_observer.h should probably be
cschuet (SLOW) 2015/01/07 14:37:07 Done.
cschuet (SLOW) 2015/01/07 14:37:07 Done.
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/login/login_state.h"
@@ -42,7 +43,6 @@ class User;
}
namespace chromeos {
-
class SystemTrayDelegateChromeOS
: public ui::ime::InputMethodMenuManager::Observer,
public ash::SystemTrayDelegate,
@@ -57,7 +57,8 @@ class SystemTrayDelegateChromeOS
public chrome::BrowserListObserver,
public extensions::AppWindowRegistry::Observer,
public user_manager::UserManager::UserSessionStateObserver,
- public SupervisedUserServiceObserver {
+ public SupervisedUserServiceObserver,
+ public ShutdownPolicyObserver::Delegate {
public:
SystemTrayDelegateChromeOS();
@@ -97,6 +98,7 @@ class SystemTrayDelegateChromeOS
void ShowSupervisedUserInfo() override;
void ShowEnterpriseInfo() override;
void ShowUserLogin() override;
+ void Restart() override;
void ShutDown() override;
void SignOut() override;
void RequestLockScreen() override;
@@ -132,6 +134,12 @@ class SystemTrayDelegateChromeOS
ash::CustodianInfoTrayObserver* observer) override;
void RemoveCustodianInfoTrayObserver(
ash::CustodianInfoTrayObserver* observer) override;
+ void AddShutdownPolicyObserver(
+ ash::ShutdownPolicyObserver* observer) override;
+ void ShouldRebootOnShutdown(
+ const ash::RebootOnShutdownCallback& callback) override;
+ void RemoveShutdownPolicyObserver(
+ ash::ShutdownPolicyObserver* observer) override;
// Overridden from user_manager::UserManager::UserSessionStateObserver:
void UserAddedToSession(const user_manager::User* active_user) override;
@@ -250,6 +258,9 @@ class SystemTrayDelegateChromeOS
void OnAccessibilityStatusChanged(
const AccessibilityStatusEventDetails& details);
+ // Overridden from ShutdownPolicyObserver::Delegate.
+ void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
+
scoped_ptr<content::NotificationRegistrar> registrar_;
scoped_ptr<PrefChangeRegistrar> local_state_registrar_;
scoped_ptr<PrefChangeRegistrar> user_pref_registrar_;
@@ -272,10 +283,13 @@ class SystemTrayDelegateChromeOS
scoped_ptr<AccessibilityStatusSubscription> accessibility_subscription_;
base::ScopedPtrHashMap<std::string, ash::tray::UserAccountsDelegate>
accounts_delegates_;
+ scoped_ptr<ShutdownPolicyObserver> shutdown_policy_observer_;
Daniel Erat 2014/12/17 16:21:04 please improve the naming here. it's confusing to
stevenjb 2014/12/17 19:09:02 +1, I suggest the following: * The existing Shutdo
cschuet (SLOW) 2015/01/07 14:37:07 Done.
cschuet (SLOW) 2015/01/07 14:37:07 Done.
ObserverList<ash::CustodianInfoTrayObserver>
custodian_info_changed_observers_;
+ ObserverList<ash::ShutdownPolicyObserver, true> shutdown_policy_observers_;
+
base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS);

Powered by Google App Engine
This is Rietveld 408576698