summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormerkulova <merkulova@chromium.org>2015-01-30 03:15:26 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-30 11:16:22 +0000
commit72a49c1e70b07101c1a22161914adc297a4d0e42 (patch)
treeefa1d615ae0558431036e071210c92f104cba7f1 /ash
parent1b679aba64700d3592c2155436a3203251d6297c (diff)
downloadchromium_src-72a49c1e70b07101c1a22161914adc297a4d0e42.zip
chromium_src-72a49c1e70b07101c1a22161914adc297a4d0e42.tar.gz
chromium_src-72a49c1e70b07101c1a22161914adc297a4d0e42.tar.bz2
Child accounts icons added to Chrome OS notifications.
BUG=434643 TBR=jennyz@chromium.org Review URL: https://codereview.chromium.org/871373011 Cr-Commit-Position: refs/heads/master@{#313897}
Diffstat (limited to 'ash')
-rw-r--r--ash/resources/ash_resources.grd1
-rw-r--r--ash/resources/default_100_percent/cros/status/status_child_user.pngbin0 -> 260 bytes
-rw-r--r--ash/resources/default_200_percent/cros/status/status_child_user.pngbin0 -> 480 bytes
-rw-r--r--ash/system/chromeos/supervised/tray_supervised_user.cc19
-rw-r--r--ash/system/chromeos/supervised/tray_supervised_user.h2
5 files changed, 17 insertions, 5 deletions
diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd
index ca8c446..839a289 100644
--- a/ash/resources/ash_resources.grd
+++ b/ash/resources/ash_resources.grd
@@ -123,6 +123,7 @@
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_CELLULAR_DISABLED_HOVER" file="cros/network/status_cellular_disabled_hover.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_CELLULAR_ENABLED" file="cros/network/status_cellular_enabled.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_CELLULAR_ENABLED_HOVER" file="cros/network/status_cellular_enabled_hover.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_CHILD_USER" file="cros/status/status_child_user.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_DISPLAY" file="cros/status/status_display_dark.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_ENTERPRISE" file="cros/status/status_managed.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_LOGOUT_BUTTON_NORMAL_BOTTOM" file="cros/status/status_logout_button_normal_bottom.png" />
diff --git a/ash/resources/default_100_percent/cros/status/status_child_user.png b/ash/resources/default_100_percent/cros/status/status_child_user.png
new file mode 100644
index 0000000..0770397
--- /dev/null
+++ b/ash/resources/default_100_percent/cros/status/status_child_user.png
Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_child_user.png b/ash/resources/default_200_percent/cros/status/status_child_user.png
new file mode 100644
index 0000000..186aa7e
--- /dev/null
+++ b/ash/resources/default_200_percent/cros/status/status_child_user.png
Binary files differ
diff --git a/ash/system/chromeos/supervised/tray_supervised_user.cc b/ash/system/chromeos/supervised/tray_supervised_user.cc
index 53287e6..65b7481 100644
--- a/ash/system/chromeos/supervised/tray_supervised_user.cc
+++ b/ash/system/chromeos/supervised/tray_supervised_user.cc
@@ -60,7 +60,7 @@ views::View* TraySupervisedUser::CreateDefaultView(
if (!delegate->IsUserSupervised())
return NULL;
- tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_SUPERVISED_USER);
+ tray_view_ = new LabelTrayView(this, GetSupervisedUserIconId());
UpdateMessage();
return tray_view_;
}
@@ -96,10 +96,8 @@ void TraySupervisedUser::CreateOrUpdateNotification(
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
scoped_ptr<Notification> notification(
message_center::Notification::CreateSystemNotification(
- kNotificationId,
- base::string16() /* no title */,
- new_message,
- bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SUPERVISED_USER),
+ kNotificationId, base::string16() /* no title */, new_message,
+ bundle.GetImageNamed(GetSupervisedUserIconId()),
system_notifier::kNotifierSupervisedUser,
base::Closure() /* null callback */));
message_center::MessageCenter::Get()->AddNotification(notification.Pass());
@@ -123,4 +121,15 @@ void TraySupervisedUser::OnCustodianInfoChanged() {
}
}
+int TraySupervisedUser::GetSupervisedUserIconId() const {
+ SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+
+ // Not intended to be used for non-supervised users.
+ CHECK(delegate->IsUserSupervised());
+
+ if (delegate->IsUserChild())
+ return IDR_AURA_UBER_TRAY_CHILD_USER;
+ return IDR_AURA_UBER_TRAY_SUPERVISED_USER;
+}
+
} // namespace ash
diff --git a/ash/system/chromeos/supervised/tray_supervised_user.h b/ash/system/chromeos/supervised/tray_supervised_user.h
index 3c2b0ce..1f44fef 100644
--- a/ash/system/chromeos/supervised/tray_supervised_user.h
+++ b/ash/system/chromeos/supervised/tray_supervised_user.h
@@ -46,6 +46,8 @@ class ASH_EXPORT TraySupervisedUser : public SystemTrayItem,
void CreateOrUpdateSupervisedWarningNotification();
+ int GetSupervisedUserIconId() const;
+
LabelTrayView* tray_view_;
// Previous login status to avoid showing notification upon unlock.