diff options
author | Xiyuan Xia <xiyuan@chromium.org> | 2014-11-14 08:57:49 -0800 |
---|---|---|
committer | Xiyuan Xia <xiyuan@chromium.org> | 2014-11-14 16:59:18 +0000 |
commit | 8cc6448413dfc3112e310da6dd096c696d628a84 (patch) | |
tree | dd1e2ffa490f3db0ee7dcd659b4d1a9aebef7657 | |
parent | 77ef6462cf70604a2a7139c025f9a5fc75be3c35 (diff) | |
download | chromium_src-8cc6448413dfc3112e310da6dd096c696d628a84.zip chromium_src-8cc6448413dfc3112e310da6dd096c696d628a84.tar.gz chromium_src-8cc6448413dfc3112e310da6dd096c696d628a84.tar.bz2 |
Merge "easy-unlock: Add icon for pairing changed state."
> BUG=430729
>
> Review URL: https://codereview.chromium.org/718923002
>
> Cr-Commit-Position: refs/heads/master@{#303911}
> (cherry picked from commit 931ffd546bc4a324779f4dcb137605f11a917a31)
TBR=xiyuan@chromium.org
Review URL: https://codereview.chromium.org/728883002
Cr-Commit-Position: refs/branch-heads/2214@{#45}
Cr-Branched-From: 03655fd3f6d72165dc3c9bd2c89807305316fe6c-refs/heads/master@{#303346}
13 files changed, 37 insertions, 2 deletions
diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc index d3458cc..30a29bb 100644 --- a/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc +++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc @@ -232,6 +232,10 @@ void EasyUnlockScreenlockStateHandler::ShowHardlockUI() { ScreenlockBridge::UserPodCustomIconOptions icon_options; if (hardlock_state_ == LOGIN_FAILED) { icon_options.SetIcon(ScreenlockBridge::USER_POD_CUSTOM_ICON_LOCKED); + } else if (hardlock_state_ == PAIRING_CHANGED || + hardlock_state_ == PAIRING_ADDED) { + icon_options.SetIcon( + ScreenlockBridge::USER_POD_CUSTOM_ICON_LOCKED_TO_BE_ACTIVATED); } else { icon_options.SetIcon(ScreenlockBridge::USER_POD_CUSTOM_ICON_HARDLOCKED); } diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc index 4c0e89b..2a87f99 100644 --- a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc +++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc @@ -20,6 +20,7 @@ namespace { // Icons used by EasyUnlockScreenlockStateHandler. The icon id values are the // same as the ones set by ScreenlockBridge. const char kLockedIconId[] = "locked"; +const char kLockedToBeActivatedIconId[] = "locked-to-be-activated"; const char kUnlockedIconId[] = "unlocked"; const char kSpinnerIconId[] = "spinner"; const char kHardlockedIconId[] = "hardlocked"; @@ -565,14 +566,14 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, PairingChangedHardlock) { EXPECT_EQ(1u, lock_handler_->GetAndResetShowIconCount()); ASSERT_TRUE(lock_handler_->HasCustomIcon()); - EXPECT_EQ(kHardlockedIconId, lock_handler_->GetCustomIconId()); + EXPECT_EQ(kLockedToBeActivatedIconId, lock_handler_->GetCustomIconId()); state_handler_->ChangeState( EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED); EXPECT_EQ(0u, lock_handler_->GetAndResetShowIconCount()); ASSERT_TRUE(lock_handler_->HasCustomIcon()); - EXPECT_EQ(kHardlockedIconId, lock_handler_->GetCustomIconId()); + EXPECT_EQ(kLockedToBeActivatedIconId, lock_handler_->GetCustomIconId()); } TEST_F(EasyUnlockScreenlockStateHandlerTest, diff --git a/chrome/browser/signin/screenlock_bridge.cc b/chrome/browser/signin/screenlock_bridge.cc index b11b51e5..1883814 100644 --- a/chrome/browser/signin/screenlock_bridge.cc +++ b/chrome/browser/signin/screenlock_bridge.cc @@ -24,6 +24,7 @@ base::LazyInstance<ScreenlockBridge> g_screenlock_bridge_bridge_instance = // account picker as user pod custom icons. // The id's should be kept in sync with values used by user_pod_row.js. const char kLockedUserPodCustomIconId[] = "locked"; +const char kLockedToBeActivatedUserPodCustomIconId[] = "locked-to-be-activated"; const char kLockedWithProximityHintUserPodCustomIconId[] = "locked-with-proximity-hint"; const char kUnlockedUserPodCustomIconId[] = "unlocked"; @@ -35,6 +36,8 @@ std::string GetIdForIcon(ScreenlockBridge::UserPodCustomIcon icon) { switch (icon) { case ScreenlockBridge::USER_POD_CUSTOM_ICON_LOCKED: return kLockedUserPodCustomIconId; + case ScreenlockBridge::USER_POD_CUSTOM_ICON_LOCKED_TO_BE_ACTIVATED: + return kLockedToBeActivatedUserPodCustomIconId; case ScreenlockBridge::USER_POD_CUSTOM_ICON_LOCKED_WITH_PROXIMITY_HINT: return kLockedWithProximityHintUserPodCustomIconId; case ScreenlockBridge::USER_POD_CUSTOM_ICON_UNLOCKED: diff --git a/chrome/browser/signin/screenlock_bridge.h b/chrome/browser/signin/screenlock_bridge.h index bf77832..1cfba53 100644 --- a/chrome/browser/signin/screenlock_bridge.h +++ b/chrome/browser/signin/screenlock_bridge.h @@ -42,6 +42,7 @@ class ScreenlockBridge { USER_POD_CUSTOM_ICON_NONE, USER_POD_CUSTOM_ICON_HARDLOCKED, USER_POD_CUSTOM_ICON_LOCKED, + USER_POD_CUSTOM_ICON_LOCKED_TO_BE_ACTIVATED, // TODO(isherman): The "locked with proximity hint" icon is currently the // same as the "locked" icon. It's treated as a separate case to allow an // easy asset swap without changing the code, in case we decide to use a diff --git a/ui/login/account_picker/user_pod_row.css b/ui/login/account_picker/user_pod_row.css index 246c1fb..780fec9 100644 --- a/ui/login/account_picker/user_pod_row.css +++ b/ui/login/account_picker/user_pod_row.css @@ -259,6 +259,21 @@ html[dir=rtl] .main-pane { background-image: url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_PRESSED'); } +.custom-icon-locked-to-be-activated { + background-image: + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED'); +} + +.custom-icon-locked-to-be-activated.icon-with-tooltip:hover { + background-image: + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_HOVER'); +} + +.custom-icon-locked-to-be-activated.interactive-custom-icon:active { + background-image: + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_PRESSED'); +} + .custom-icon-locked-with-proximity-hint { background-image: url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT'); @@ -299,6 +314,12 @@ html[dir=rtl] .main-pane { url('chrome://theme/IDR_EASY_UNLOCK_LOCKED') url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_HOVER') url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_PRESSED') + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED') + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_HOVER') + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_PRESSED') + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT') + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT_HOVER') + url('chrome://theme/IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT_PRESSED') url('chrome://theme/IDR_EASY_UNLOCK_UNLOCKED') url('chrome://theme/IDR_EASY_UNLOCK_UNLOCKED_HOVER') url('chrome://theme/IDR_EASY_UNLOCK_UNLOCKED_PRESSED'); diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js index ec32f89..f4adf57 100644 --- a/ui/login/account_picker/user_pod_row.js +++ b/ui/login/account_picker/user_pod_row.js @@ -191,6 +191,8 @@ cr.define('login', function() { */ UserPodCustomIcon.ICONS = [ {id: 'locked', class: 'custom-icon-locked'}, + {id: 'locked-to-be-activated', + class: 'custom-icon-locked-to-be-activated'}, {id: 'locked-with-proximity-hint', class: 'custom-icon-locked-with-proximity-hint'}, {id: 'unlocked', class: 'custom-icon-unlocked'}, diff --git a/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated.png b/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated.png Binary files differnew file mode 100644 index 0000000..73a83c0 --- /dev/null +++ b/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated.png diff --git a/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated_hover.png b/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated_hover.png Binary files differnew file mode 100644 index 0000000..45abc6e --- /dev/null +++ b/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated_hover.png diff --git a/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated_pressed.png b/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated_pressed.png Binary files differnew file mode 100644 index 0000000..a41cbeb --- /dev/null +++ b/ui/resources/default_100_percent/common/easy_unlock_locked_to_be_activated_pressed.png diff --git a/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated.png b/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated.png Binary files differnew file mode 100644 index 0000000..37c36b95 --- /dev/null +++ b/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated.png diff --git a/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated_hover.png b/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated_hover.png Binary files differnew file mode 100644 index 0000000..4b488c2 --- /dev/null +++ b/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated_hover.png diff --git a/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated_pressed.png b/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated_pressed.png Binary files differnew file mode 100644 index 0000000..dd7de16 --- /dev/null +++ b/ui/resources/default_200_percent/common/easy_unlock_locked_to_be_activated_pressed.png diff --git a/ui/resources/ui_resources.grd b/ui/resources/ui_resources.grd index 7b33c23..cadb517 100644 --- a/ui/resources/ui_resources.grd +++ b/ui/resources/ui_resources.grd @@ -270,6 +270,9 @@ <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED" file="common/easy_unlock_locked.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_HOVER" file="common/easy_unlock_locked_hover.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_PRESSED" file="common/easy_unlock_locked_pressed.png" /> + <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED" file="common/easy_unlock_locked_to_be_activated.png" /> + <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_HOVER" file="common/easy_unlock_locked_to_be_activated_hover.png" /> + <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_TO_BE_ACTIVATED_PRESSED" file="common/easy_unlock_locked_to_be_activated_pressed.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT" file="common/easy_unlock_locked_with_proximity_hint.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT_HOVER" file="common/easy_unlock_locked_with_proximity_hint_hover.png" /> <structure type="chrome_scaled_image" name="IDR_EASY_UNLOCK_LOCKED_WITH_PROXIMITY_HINT_PRESSED" file="common/easy_unlock_locked_with_proximity_hint_pressed.png" /> |