| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" | 5 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // icon. Once the reduced proximity range flag is removed, consider | 38 // icon. Once the reduced proximity range flag is removed, consider |
| 39 // deleting the redundant icon. | 39 // deleting the redundant icon. |
| 40 return proximity_auth::ScreenlockBridge:: | 40 return proximity_auth::ScreenlockBridge:: |
| 41 USER_POD_CUSTOM_ICON_LOCKED_WITH_PROXIMITY_HINT; | 41 USER_POD_CUSTOM_ICON_LOCKED_WITH_PROXIMITY_HINT; |
| 42 case ScreenlockState::BLUETOOTH_CONNECTING: | 42 case ScreenlockState::BLUETOOTH_CONNECTING: |
| 43 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_SPINNER; | 43 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_SPINNER; |
| 44 case ScreenlockState::AUTHENTICATED: | 44 case ScreenlockState::AUTHENTICATED: |
| 45 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_UNLOCKED; | 45 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_UNLOCKED; |
| 46 case ScreenlockState::INACTIVE: | 46 case ScreenlockState::INACTIVE: |
| 47 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE; | 47 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE; |
| 48 case ScreenlockState::PASSWORD_REAUTH: |
| 49 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_HARDLOCKED; |
| 48 } | 50 } |
| 49 | 51 |
| 50 NOTREACHED(); | 52 NOTREACHED(); |
| 51 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE; | 53 return proximity_auth::ScreenlockBridge::USER_POD_CUSTOM_ICON_NONE; |
| 52 } | 54 } |
| 53 | 55 |
| 54 bool HardlockOnClick(ScreenlockState state) { | 56 bool HardlockOnClick(ScreenlockState state) { |
| 55 return state != ScreenlockState::INACTIVE; | 57 return state != ScreenlockState::INACTIVE; |
| 56 } | 58 } |
| 57 | 59 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 71 case ScreenlockState::PHONE_NOT_LOCKABLE: | 73 case ScreenlockState::PHONE_NOT_LOCKABLE: |
| 72 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PHONE_UNLOCKABLE; | 74 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PHONE_UNLOCKABLE; |
| 73 case ScreenlockState::PHONE_UNSUPPORTED: | 75 case ScreenlockState::PHONE_UNSUPPORTED: |
| 74 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_UNSUPPORTED_ANDROID_VERSION; | 76 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_UNSUPPORTED_ANDROID_VERSION; |
| 75 case ScreenlockState::RSSI_TOO_LOW: | 77 case ScreenlockState::RSSI_TOO_LOW: |
| 76 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_RSSI_TOO_LOW; | 78 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_RSSI_TOO_LOW; |
| 77 case ScreenlockState::PHONE_LOCKED_AND_RSSI_TOO_LOW: | 79 case ScreenlockState::PHONE_LOCKED_AND_RSSI_TOO_LOW: |
| 78 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PHONE_LOCKED_AND_RSSI_TOO_LOW; | 80 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PHONE_LOCKED_AND_RSSI_TOO_LOW; |
| 79 case ScreenlockState::AUTHENTICATED: | 81 case ScreenlockState::AUTHENTICATED: |
| 80 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_HARDLOCK_INSTRUCTIONS; | 82 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_HARDLOCK_INSTRUCTIONS; |
| 83 case ScreenlockState::PASSWORD_REAUTH: |
| 84 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PASSWORD_REAUTH; |
| 81 } | 85 } |
| 82 | 86 |
| 83 NOTREACHED(); | 87 NOTREACHED(); |
| 84 return 0; | 88 return 0; |
| 85 } | 89 } |
| 86 | 90 |
| 87 bool TooltipContainsDeviceType(ScreenlockState state) { | 91 bool TooltipContainsDeviceType(ScreenlockState state) { |
| 88 return (state == ScreenlockState::AUTHENTICATED || | 92 return (state == ScreenlockState::AUTHENTICATED || |
| 89 state == ScreenlockState::PHONE_NOT_LOCKABLE || | 93 state == ScreenlockState::PHONE_NOT_LOCKABLE || |
| 90 state == ScreenlockState::NO_BLUETOOTH || | 94 state == ScreenlockState::NO_BLUETOOTH || |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); | 389 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); |
| 386 } | 390 } |
| 387 } else if (existing_auth_type != | 391 } else if (existing_auth_type != |
| 388 proximity_auth::ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { | 392 proximity_auth::ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { |
| 389 screenlock_bridge_->lock_handler()->SetAuthType( | 393 screenlock_bridge_->lock_handler()->SetAuthType( |
| 390 account_id_, | 394 account_id_, |
| 391 proximity_auth::ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, | 395 proximity_auth::ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, |
| 392 base::string16()); | 396 base::string16()); |
| 393 } | 397 } |
| 394 } | 398 } |
| OLD | NEW |