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

Unified Diff: ash/system/chromeos/supervised/tray_supervised_user.cc

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 6 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
Index: ash/system/chromeos/supervised/tray_supervised_user.cc
diff --git a/ash/system/chromeos/supervised/tray_supervised_user.cc b/ash/system/chromeos/supervised/tray_supervised_user.cc
index ab8feb0c00966a04ae18b5d6aabb84dbe73cb191..c260140b453a2a23e37c129921ef6a0b8dc41b4d 100644
--- a/ash/system/chromeos/supervised/tray_supervised_user.cc
+++ b/ash/system/chromeos/supervised/tray_supervised_user.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "ash/common/system/tray/system_tray_delegate.h"
-#include "ash/shell.h"
+#include "ash/common/wm_shell.h"
#include "ash/system/chromeos/label_tray_view.h"
#include "ash/system/system_notifier.h"
#include "ash/system/tray/system_tray_notifier.h"
@@ -33,21 +33,20 @@ TraySupervisedUser::TraySupervisedUser(SystemTray* system_tray)
tray_view_(NULL),
status_(LoginStatus::NOT_LOGGED_IN),
is_user_supervised_(false) {
- Shell::GetInstance()->system_tray_delegate()->
- AddCustodianInfoTrayObserver(this);
+ WmShell::Get()->system_tray_delegate()->AddCustodianInfoTrayObserver(this);
}
TraySupervisedUser::~TraySupervisedUser() {
// We need the check as on shell destruction delegate is destroyed first.
SystemTrayDelegate* system_tray_delegate =
- Shell::GetInstance()->system_tray_delegate();
+ WmShell::Get()->system_tray_delegate();
if (system_tray_delegate)
system_tray_delegate->RemoveCustodianInfoTrayObserver(this);
}
void TraySupervisedUser::UpdateMessage() {
- base::string16 message = Shell::GetInstance()->system_tray_delegate()->
- GetSupervisedUserMessage();
+ base::string16 message =
+ WmShell::Get()->system_tray_delegate()->GetSupervisedUserMessage();
if (tray_view_)
tray_view_->SetMessage(message);
if (message_center::MessageCenter::Get()->FindVisibleNotificationById(
@@ -57,7 +56,7 @@ void TraySupervisedUser::UpdateMessage() {
views::View* TraySupervisedUser::CreateDefaultView(LoginStatus status) {
CHECK(tray_view_ == NULL);
- SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
if (!delegate->IsUserSupervised())
return NULL;
@@ -71,11 +70,11 @@ void TraySupervisedUser::DestroyDefaultView() {
}
void TraySupervisedUser::OnViewClicked(views::View* sender) {
- Shell::GetInstance()->system_tray_delegate()->ShowSupervisedUserInfo();
+ WmShell::Get()->system_tray_delegate()->ShowSupervisedUserInfo();
}
void TraySupervisedUser::UpdateAfterLoginStatusChange(LoginStatus status) {
- SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
bool is_user_supervised = delegate->IsUserSupervised();
if (status == status_ && is_user_supervised == is_user_supervised_)
@@ -104,12 +103,12 @@ void TraySupervisedUser::CreateOrUpdateNotification(
}
void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() {
- SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
CreateOrUpdateNotification(delegate->GetSupervisedUserMessage());
}
void TraySupervisedUser::OnCustodianInfoChanged() {
- SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
std::string manager_name = delegate->GetSupervisedUserManager();
if (!manager_name.empty()) {
if (!delegate->IsUserChild() &&
@@ -122,7 +121,7 @@ void TraySupervisedUser::OnCustodianInfoChanged() {
}
int TraySupervisedUser::GetSupervisedUserIconId() const {
- SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
// Not intended to be used for non-supervised users.
CHECK(delegate->IsUserSupervised());

Powered by Google App Engine
This is Rietveld 408576698