| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void EasyUnlockScreenlockStateHandler::OnScreenDidLock() { | 145 void EasyUnlockScreenlockStateHandler::OnScreenDidLock() { |
| 146 State last_state = state_; | 146 State last_state = state_; |
| 147 // This should force updating screenlock state. | 147 // This should force updating screenlock state. |
| 148 state_ = STATE_INACTIVE; | 148 state_ = STATE_INACTIVE; |
| 149 ChangeState(last_state); | 149 ChangeState(last_state); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void EasyUnlockScreenlockStateHandler::OnScreenDidUnlock() { | 152 void EasyUnlockScreenlockStateHandler::OnScreenDidUnlock() { |
| 153 } | 153 } |
| 154 | 154 |
| 155 void EasyUnlockScreenlockStateHandler::OnFocusedUserChanged( |
| 156 const std::string& user_id) { |
| 157 } |
| 158 |
| 155 void EasyUnlockScreenlockStateHandler::UpdateTooltipOptions( | 159 void EasyUnlockScreenlockStateHandler::UpdateTooltipOptions( |
| 156 bool trial_run, | 160 bool trial_run, |
| 157 ScreenlockBridge::UserPodCustomIconOptions* icon_options) { | 161 ScreenlockBridge::UserPodCustomIconOptions* icon_options) { |
| 158 size_t resource_id = 0; | 162 size_t resource_id = 0; |
| 159 base::string16 device_name; | 163 base::string16 device_name; |
| 160 if (trial_run && state_ == STATE_AUTHENTICATED) { | 164 if (trial_run && state_ == STATE_AUTHENTICATED) { |
| 161 resource_id = IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_TUTORIAL; | 165 resource_id = IDS_EASY_UNLOCK_SCREENLOCK_TOOLTIP_TUTORIAL; |
| 162 } else { | 166 } else { |
| 163 resource_id = GetTooltipResourceId(state_); | 167 resource_id = GetTooltipResourceId(state_); |
| 164 if (TooltipContainsDeviceType(state_)) | 168 if (TooltipContainsDeviceType(state_)) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 l10n_util::GetStringUTF16( | 219 l10n_util::GetStringUTF16( |
| 216 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); | 220 IDS_EASY_UNLOCK_SCREENLOCK_USER_POD_AUTH_VALUE)); |
| 217 } else if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) != | 221 } else if (screenlock_bridge_->lock_handler()->GetAuthType(user_email_) != |
| 218 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { | 222 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD) { |
| 219 screenlock_bridge_->lock_handler()->SetAuthType( | 223 screenlock_bridge_->lock_handler()->SetAuthType( |
| 220 user_email_, | 224 user_email_, |
| 221 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, | 225 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, |
| 222 base::string16()); | 226 base::string16()); |
| 223 } | 227 } |
| 224 } | 228 } |
| OLD | NEW |