| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 state == EasyUnlockScreenlockStateHandler::STATE_PHONE_NOT_NEARBY || | 45 state == EasyUnlockScreenlockStateHandler::STATE_PHONE_NOT_NEARBY || |
| 46 state == EasyUnlockScreenlockStateHandler::STATE_PHONE_UNLOCKABLE || | 46 state == EasyUnlockScreenlockStateHandler::STATE_PHONE_UNLOCKABLE || |
| 47 state == EasyUnlockScreenlockStateHandler::STATE_PHONE_UNSUPPORTED; | 47 state == EasyUnlockScreenlockStateHandler::STATE_PHONE_UNSUPPORTED; |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool HasAnimation(EasyUnlockScreenlockStateHandler::State state) { | 50 bool HasAnimation(EasyUnlockScreenlockStateHandler::State state) { |
| 51 return state == EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING; | 51 return state == EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING; |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool HardlockOnClick(EasyUnlockScreenlockStateHandler::State state) { | 54 bool HardlockOnClick(EasyUnlockScreenlockStateHandler::State state) { |
| 55 return state == EasyUnlockScreenlockStateHandler::STATE_AUTHENTICATED; | 55 return state != EasyUnlockScreenlockStateHandler::STATE_INACTIVE; |
| 56 } | 56 } |
| 57 | 57 |
| 58 size_t GetTooltipResourceId(EasyUnlockScreenlockStateHandler::State state) { | 58 size_t GetTooltipResourceId(EasyUnlockScreenlockStateHandler::State state) { |
| 59 switch (state) { | 59 switch (state) { |
| 60 case EasyUnlockScreenlockStateHandler::STATE_NO_BLUETOOTH: | 60 case EasyUnlockScreenlockStateHandler::STATE_NO_BLUETOOTH: |
| 61 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_NO_BLUETOOTH; | 61 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_NO_BLUETOOTH; |
| 62 case EasyUnlockScreenlockStateHandler::STATE_NO_PHONE: | 62 case EasyUnlockScreenlockStateHandler::STATE_NO_PHONE: |
| 63 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_NO_PHONE; | 63 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_NO_PHONE; |
| 64 case EasyUnlockScreenlockStateHandler::STATE_PHONE_NOT_AUTHENTICATED: | 64 case EasyUnlockScreenlockStateHandler::STATE_PHONE_NOT_AUTHENTICATED: |
| 65 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PHONE_NOT_AUTHENTICATED; | 65 return IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_PHONE_NOT_AUTHENTICATED; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 l10n_util::GetStringUTF16( | 227 l10n_util::GetStringUTF16( |
| 228 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); | 228 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); |
| 229 } else if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) != | 229 } else if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) != |
| 230 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { | 230 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { |
| 231 screenlock_bridge_->lock_handler()->SetAuthType( | 231 screenlock_bridge_->lock_handler()->SetAuthType( |
| 232 user_email_, | 232 user_email_, |
| 233 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, | 233 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, |
| 234 base::string16()); | 234 base::string16()); |
| 235 } | 235 } |
| 236 } | 236 } |
| OLD | NEW |