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

Unified Diff: ash/system/supervised/tray_supervised_user.h

Issue 2832903002: cros: Remove supervised user methods from SystemTrayDelegate (Closed)
Patch Set: rebase Created 3 years, 8 months 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
« no previous file with comments | « ash/system/supervised/custodian_info_tray_observer.h ('k') | ash/system/supervised/tray_supervised_user.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/supervised/tray_supervised_user.h
diff --git a/ash/system/supervised/tray_supervised_user.h b/ash/system/supervised/tray_supervised_user.h
index 7b3a7c530c64e84203a3a766c326a6a773950222..dd0429221b103ffd09e992c6eed4db317e288edf 100644
--- a/ash/system/supervised/tray_supervised_user.h
+++ b/ash/system/supervised/tray_supervised_user.h
@@ -6,60 +6,43 @@
#define ASH_SYSTEM_SUPERVISED_TRAY_SUPERVISED_USER_H_
#include "ash/ash_export.h"
-#include "ash/system/supervised/custodian_info_tray_observer.h"
+#include "ash/session/session_observer.h"
#include "ash/system/tray/system_tray_item.h"
-#include "ash/system/tray/view_click_listener.h"
#include "base/macros.h"
#include "base/strings/string16.h"
-namespace gfx {
-struct VectorIcon;
-} // namespace gfx
-
namespace ash {
-class LabelTrayView;
+
class SystemTray;
+// System tray item that shows a message if the user is supervised or a child.
+// Also shows a notification on login if the user is supervised. Shows a new
+// notification if the user manager/custodian changes.
class ASH_EXPORT TraySupervisedUser : public SystemTrayItem,
- public ViewClickListener,
- public CustodianInfoTrayObserver {
+ public SessionObserver {
public:
explicit TraySupervisedUser(SystemTray* system_tray);
~TraySupervisedUser() override;
- // If message is not empty updates content of default view, otherwise hides
- // tray items.
- void UpdateMessage();
-
- // Overridden from SystemTrayItem.
+ // SystemTrayItem:
views::View* CreateDefaultView(LoginStatus status) override;
- void DestroyDefaultView() override;
- void UpdateAfterLoginStatusChange(LoginStatus status) override;
- // Overridden from ViewClickListener.
- void OnViewClicked(views::View* sender) override;
-
- // Overridden from CustodianInfoTrayObserver:
- void OnCustodianInfoChanged() override;
+ // SessionObserver:
+ void OnUserSessionUpdated(const AccountId& account_id) override;
private:
friend class TraySupervisedUserTest;
static const char kNotificationId[];
- void CreateOrUpdateNotification(const base::string16& new_message);
-
- void CreateOrUpdateSupervisedWarningNotification();
-
- const gfx::VectorIcon& GetSupervisedUserIcon() const;
+ void CreateOrUpdateNotification();
- LabelTrayView* tray_view_;
+ base::string16 GetSupervisedUserMessage() const;
- // Previous login status to avoid showing notification upon unlock.
- LoginStatus status_;
+ std::string custodian_email_;
+ std::string second_custodian_email_;
- // Previous user supervised state to avoid showing notification upon unlock.
- bool is_user_supervised_;
+ ScopedSessionObserver scoped_session_observer_;
DISALLOW_COPY_AND_ASSIGN(TraySupervisedUser);
};
« no previous file with comments | « ash/system/supervised/custodian_info_tray_observer.h ('k') | ash/system/supervised/tray_supervised_user.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698