summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormerkulova <merkulova@chromium.org>2014-12-22 07:26:41 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-22 15:27:24 +0000
commit73b32fca8ed133af29af871d2108f9ea5de7f0bf (patch)
tree341126561ec2fce7b4a9666da7b1b6f21606b348 /ash
parentbd9874ec5a46c8af7f67132d40ac1fea191ba242 (diff)
downloadchromium_src-73b32fca8ed133af29af871d2108f9ea5de7f0bf.zip
chromium_src-73b32fca8ed133af29af871d2108f9ea5de7f0bf.tar.gz
chromium_src-73b32fca8ed133af29af871d2108f9ea5de7f0bf.tar.bz2
Tray message changed for child accounts. Warning bubble removed for child accounts.
BUG=435130, 439941 CL based on https://chromereviews.googleplex.com/ TBR=jennyz@chromium.org Review URL: https://codereview.chromium.org/783963002 Cr-Commit-Position: refs/heads/master@{#309427}
Diffstat (limited to 'ash')
-rw-r--r--ash/system/chromeos/supervised/tray_supervised_user.cc7
-rw-r--r--ash/system/tray/default_system_tray_delegate.cc4
-rw-r--r--ash/system/tray/default_system_tray_delegate.h1
-rw-r--r--ash/system/tray/system_tray_delegate.h8
4 files changed, 17 insertions, 3 deletions
diff --git a/ash/system/chromeos/supervised/tray_supervised_user.cc b/ash/system/chromeos/supervised/tray_supervised_user.cc
index aa47fcf..53287e6 100644
--- a/ash/system/chromeos/supervised/tray_supervised_user.cc
+++ b/ash/system/chromeos/supervised/tray_supervised_user.cc
@@ -82,6 +82,7 @@ void TraySupervisedUser::UpdateAfterLoginStatusChange(
return;
if (is_user_supervised &&
+ !delegate->IsUserChild() &&
status_ != ash::user::LOGGED_IN_LOCKED &&
!delegate->GetSupervisedUserManager().empty())
CreateOrUpdateSupervisedWarningNotification();
@@ -113,9 +114,11 @@ void TraySupervisedUser::OnCustodianInfoChanged() {
SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
std::string manager_name = delegate->GetSupervisedUserManager();
if (!manager_name.empty()) {
- if (!message_center::MessageCenter::Get()->FindVisibleNotificationById(
- kNotificationId))
+ if (!delegate->IsUserChild() &&
+ !message_center::MessageCenter::Get()->FindVisibleNotificationById(
+ kNotificationId)) {
CreateOrUpdateSupervisedWarningNotification();
+ }
UpdateMessage();
}
}
diff --git a/ash/system/tray/default_system_tray_delegate.cc b/ash/system/tray/default_system_tray_delegate.cc
index 2d4f385..e56f642 100644
--- a/ash/system/tray/default_system_tray_delegate.cc
+++ b/ash/system/tray/default_system_tray_delegate.cc
@@ -86,6 +86,10 @@ bool DefaultSystemTrayDelegate::IsUserSupervised() const {
return GetUserLoginStatus() == ash::user::LOGGED_IN_SUPERVISED;
}
+bool DefaultSystemTrayDelegate::IsUserChild() const {
+ return false;
+}
+
void DefaultSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo* info) const {
DCHECK(info);
info->severity = UpdateInfo::UPDATE_NORMAL;
diff --git a/ash/system/tray/default_system_tray_delegate.h b/ash/system/tray/default_system_tray_delegate.h
index ce9a618..7a7a4ff 100644
--- a/ash/system/tray/default_system_tray_delegate.h
+++ b/ash/system/tray/default_system_tray_delegate.h
@@ -29,6 +29,7 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
const base::string16 GetSupervisedUserManagerName() const override;
const base::string16 GetSupervisedUserMessage() const override;
bool IsUserSupervised() const override;
+ bool IsUserChild() const override;
void GetSystemUpdateInfo(UpdateInfo* info) const override;
base::HourClockType GetHourClockType() const override;
void ShowSettings() override;
diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h
index 228865b..b840e48 100644
--- a/ash/system/tray/system_tray_delegate.h
+++ b/ash/system/tray/system_tray_delegate.h
@@ -137,9 +137,15 @@ class ASH_EXPORT SystemTrayDelegate {
// Returns the notification for supervised users.
virtual const base::string16 GetSupervisedUserMessage() const = 0;
- // Returns true if the current user is supervised.
+ // Returns true if the current user is supervised: has legacy supervised
+ // account or kid account.
virtual bool IsUserSupervised() const = 0;
+ // Returns true if the current user is child.
+ // TODO(merkulova): remove on FakeUserManager componentization.
+ // crbug.com/443119
+ virtual bool IsUserChild() const = 0;
+
// Fills |info| structure with current update info.
virtual void GetSystemUpdateInfo(UpdateInfo* info) const = 0;