diff options
author | merkulova <merkulova@chromium.org> | 2015-01-30 03:15:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-30 11:16:22 +0000 |
commit | 72a49c1e70b07101c1a22161914adc297a4d0e42 (patch) | |
tree | efa1d615ae0558431036e071210c92f104cba7f1 | |
parent | 1b679aba64700d3592c2155436a3203251d6297c (diff) | |
download | chromium_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}
-rw-r--r-- | ash/resources/ash_resources.grd | 1 | ||||
-rw-r--r-- | ash/resources/default_100_percent/cros/status/status_child_user.png | bin | 0 -> 260 bytes | |||
-rw-r--r-- | ash/resources/default_200_percent/cros/status/status_child_user.png | bin | 0 -> 480 bytes | |||
-rw-r--r-- | ash/system/chromeos/supervised/tray_supervised_user.cc | 19 | ||||
-rw-r--r-- | ash/system/chromeos/supervised/tray_supervised_user.h | 2 | ||||
-rw-r--r-- | chrome/app/theme/default_100_percent/common/child_user_invert.png | bin | 0 -> 249 bytes | |||
-rw-r--r-- | chrome/app/theme/default_200_percent/common/child_user_invert.png | bin | 0 -> 386 bytes | |||
-rw-r--r-- | chrome/app/theme/theme_resources.grd | 1 | ||||
-rw-r--r-- | ui/login/account_picker/user_pod_row.css | 4 | ||||
-rw-r--r-- | ui/login/account_picker/user_pod_row.js | 5 |
10 files changed, 25 insertions, 7 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 Binary files differnew file mode 100644 index 0000000..0770397 --- /dev/null +++ b/ash/resources/default_100_percent/cros/status/status_child_user.png 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 Binary files differnew file mode 100644 index 0000000..186aa7e --- /dev/null +++ b/ash/resources/default_200_percent/cros/status/status_child_user.png 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. diff --git a/chrome/app/theme/default_100_percent/common/child_user_invert.png b/chrome/app/theme/default_100_percent/common/child_user_invert.png Binary files differnew file mode 100644 index 0000000..ef345ba --- /dev/null +++ b/chrome/app/theme/default_100_percent/common/child_user_invert.png diff --git a/chrome/app/theme/default_200_percent/common/child_user_invert.png b/chrome/app/theme/default_200_percent/common/child_user_invert.png Binary files differnew file mode 100644 index 0000000..a42e184 --- /dev/null +++ b/chrome/app/theme/default_200_percent/common/child_user_invert.png diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 3df1146..ec1363b 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd @@ -152,6 +152,7 @@ <structure type="chrome_scaled_image" name="IDR_BUILDINGS_ILLUSTRATION" file="cros/buildings_illustration.png" /> </if> <structure type="chrome_scaled_image" name="IDR_CHEVRON_LEFT" file="common/chevron_left.png" /> + <structure type="chrome_scaled_image" name="IDR_CHILD_USER_ICON" file="common/child_user_invert.png" /> <structure type="chrome_scaled_image" name="IDR_CLOSE_BUTTON_MASK" file="common/close_button_mask.png" /> <if expr="is_win"> <structure type="chrome_scaled_image" name="IDR_CONFLICT_FAVICON" file="common/favicon_conflicts.png" /> diff --git a/ui/login/account_picker/user_pod_row.css b/ui/login/account_picker/user_pod_row.css index 078e423..b1e0b36 100644 --- a/ui/login/account_picker/user_pod_row.css +++ b/ui/login/account_picker/user_pod_row.css @@ -430,6 +430,10 @@ html[dir=rtl] .user-type-icon-area { background-image: url(chrome://theme/IDR_SUPERVISED_USER_ICON); } +.user-type-icon-area.child .user-type-icon-image { + background-image: url(chrome://theme/IDR_CHILD_USER_ICON); +} + .user-type-icon-area.policy .user-type-icon-image { background-image: url(chrome://theme/IDR_CONTROLLED_SETTING_MANDATORY); } diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js index ec5ce28..96f6e24 100644 --- a/ui/login/account_picker/user_pod_row.js +++ b/ui/login/account_picker/user_pod_row.js @@ -1033,8 +1033,9 @@ cr.define('login', function() { }, customizeUserPodPerUserType: function() { - if ((this.user_.supervisedUser || this.user_.childUser) - && !this.user_.isDesktopUser) { + if (this.user_.isChildUser && !this.user_.isDesktopUser) { + this.setUserPodIconType('child'); + } else if (this.user_.isSupervisedUser && !this.user_.isDesktopUser) { this.setUserPodIconType('supervised'); } else if (this.multiProfilesPolicyApplied) { // Mark user pod as not focusable which in addition to the grayed out |