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/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 ScreenlockBridge::UserPodCustomIconOptions icon_options; | 124 ScreenlockBridge::UserPodCustomIconOptions icon_options; |
125 icon_options.SetIcon(icon); | 125 icon_options.SetIcon(icon); |
126 | 126 |
127 // Don't hardlock on trial run. | 127 // Don't hardlock on trial run. |
128 if (!is_trial_run_ && HardlockOnClick(state_)) | 128 if (!is_trial_run_ && HardlockOnClick(state_)) |
129 icon_options.SetHardlockOnClick(); | 129 icon_options.SetHardlockOnClick(); |
130 | 130 |
131 UpdateTooltipOptions(is_trial_run_, &icon_options); | 131 UpdateTooltipOptions(is_trial_run_, &icon_options); |
132 | 132 |
| 133 // For states without tooltips, we still need to set an accessibility label. |
| 134 if (state_ == EasyUnlockScreenlockStateHandler::STATE_BLUETOOTH_CONNECTING) { |
| 135 icon_options.SetAriaLabel( |
| 136 l10n_util::GetStringUTF16(IDS_SMART_LOCK_SPINNER_ACCESSIBILITY_LABEL)); |
| 137 } |
| 138 |
133 screenlock_bridge_->lock_handler()->ShowUserPodCustomIcon(user_email_, | 139 screenlock_bridge_->lock_handler()->ShowUserPodCustomIcon(user_email_, |
134 icon_options); | 140 icon_options); |
135 } | 141 } |
136 | 142 |
137 void EasyUnlockScreenlockStateHandler::SetHardlockState( | 143 void EasyUnlockScreenlockStateHandler::SetHardlockState( |
138 HardlockState new_state) { | 144 HardlockState new_state) { |
139 if (hardlock_state_ == new_state) | 145 if (hardlock_state_ == new_state) |
140 return; | 146 return; |
141 | 147 |
142 hardlock_state_ = new_state; | 148 hardlock_state_ = new_state; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); | 290 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); |
285 } | 291 } |
286 } else if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) != | 292 } else if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) != |
287 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { | 293 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { |
288 screenlock_bridge_->lock_handler()->SetAuthType( | 294 screenlock_bridge_->lock_handler()->SetAuthType( |
289 user_email_, | 295 user_email_, |
290 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, | 296 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, |
291 base::string16()); | 297 base::string16()); |
292 } | 298 } |
293 } | 299 } |
OLD | NEW |