summaryrefslogtreecommitdiffstats
path: root/ash/system/user
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 06:07:08 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 06:07:08 +0000
commit40ad82c45d5683ed162f3d1679b2205d1757cb58 (patch)
tree5beb4e66c4d16b59a74557d768f0fdb8c7cfcf8f /ash/system/user
parent1fa707dd8c416ef590e4fba3f4b9e3d609672af9 (diff)
downloadchromium_src-40ad82c45d5683ed162f3d1679b2205d1757cb58.zip
chromium_src-40ad82c45d5683ed162f3d1679b2205d1757cb58.tar.gz
chromium_src-40ad82c45d5683ed162f3d1679b2205d1757cb58.tar.bz2
When screen locked (LOGGED_IN_LOCKED):
(1) the shutdown etc. buttons should not show up (2) the date item should not be 'activatable' (i.e no hover underline, no click) (3) the settings entry should not show up (4) the IME 'customize' option should not show up (still possible to change IME) {5} Cannot add bluethooth devices or enable/disable bluetooth (still possible to toggle bluetooth connection for individual devices) (5) clicking the network entries should not do anything (can't change network being used) (6) Cannot enable/disable wifi/cellular network When user is signed out (LOGGED_IN_NONE): (1) Hide IME settings (2) Hide Bluetooth settings (can still enable and disable bluetooth) BUG=119503 TEST=Manual Review URL: http://codereview.chromium.org/9839074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/user')
-rw-r--r--ash/system/user/login_status.h1
-rw-r--r--ash/system/user/tray_user.cc35
2 files changed, 27 insertions, 9 deletions
diff --git a/ash/system/user/login_status.h b/ash/system/user/login_status.h
index 119e42e5..635ff20 100644
--- a/ash/system/user/login_status.h
+++ b/ash/system/user/login_status.h
@@ -9,6 +9,7 @@ namespace ash {
namespace user {
enum LoginStatus {
+ LOGGED_IN_LOCKED, // A user has locked the screen.
LOGGED_IN_USER, // A normal user is logged in.
LOGGED_IN_OWNER, // The owner of the device is logged in.
LOGGED_IN_GUEST, // A guest is logged in (i.e. incognito)
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index beb8704..b8ad72a 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -105,23 +105,42 @@ namespace tray {
class UserView : public views::View,
public views::ButtonListener {
public:
- explicit UserView(ash::user::LoginStatus status)
- : username_(NULL),
+ explicit UserView(ash::user::LoginStatus login)
+ : login_(login),
+ username_(NULL),
email_(NULL),
update_(NULL),
shutdown_(NULL),
signout_(NULL),
lock_(NULL) {
- CHECK(status != ash::user::LOGGED_IN_NONE);
+ CHECK(login_ != ash::user::LOGGED_IN_NONE);
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
0, 0, 0));
set_background(views::Background::CreateSolidBackground(SK_ColorWHITE));
- bool guest = status == ash::user::LOGGED_IN_GUEST;
- bool kiosk = status == ash::user::LOGGED_IN_KIOSK;
+ bool guest = login_ == ash::user::LOGGED_IN_GUEST;
+ bool kiosk = login_ == ash::user::LOGGED_IN_KIOSK;
+ bool locked = login_ == ash::user::LOGGED_IN_LOCKED;
+
if (!guest && !kiosk)
AddUserInfo();
+ if (!guest && !kiosk && !locked)
+ RefreshForUpdate();
+
+ // A user should not be able to modify logged in state when screen is
+ // locked.
+ if (!locked)
+ AddButtonContainer();
+ }
+
+ virtual ~UserView() {}
+
+ // Create container for buttons.
+ void AddButtonContainer() {
+ bool guest = login_ == ash::user::LOGGED_IN_GUEST;
+ bool kiosk = login_ == ash::user::LOGGED_IN_KIOSK;
+
views::View* button_container = new views::View;
views::BoxLayout *layout = new
views::BoxLayout(views::BoxLayout::kHorizontal,
@@ -164,8 +183,6 @@ class UserView : public views::View,
AddChildView(button_container);
}
- virtual ~UserView() {}
-
// Shows update notification if available.
void RefreshForUpdate() {
ash::SystemTrayDelegate* tray = ash::Shell::GetInstance()->tray_delegate();
@@ -229,8 +246,6 @@ class UserView : public views::View,
user_info_->AddChildView(user);
AddChildView(user_info_);
-
- RefreshForUpdate();
}
// Overridden from views::ButtonListener.
@@ -259,6 +274,8 @@ class UserView : public views::View,
update_->SetBoundsRect(bounds);
}
+ user::LoginStatus login_;
+
views::View* user_info_;
views::Label* username_;
views::Label* email_;