| 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_service_signin_chromeos.h" | 5 #include "chrome/browser/signin/easy_unlock_service_signin_chromeos.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 void EasyUnlockServiceSignin::SetAutoPairingResult( | 259 void EasyUnlockServiceSignin::SetAutoPairingResult( |
| 260 bool success, | 260 bool success, |
| 261 const std::string& error) { | 261 const std::string& error) { |
| 262 NOTREACHED(); | 262 NOTREACHED(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void EasyUnlockServiceSignin::InitializeInternal() { | 265 void EasyUnlockServiceSignin::InitializeInternal() { |
| 266 if (chromeos::LoginState::Get()->IsUserLoggedIn()) | 266 if (chromeos::LoginState::Get()->IsUserLoggedIn()) |
| 267 return; | 267 return; |
| 268 | 268 |
| 269 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 270 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && |
| 271 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 272 proximity_auth::switches::kEnableChromeOSLogin)) { |
| 273 return; |
| 274 } |
| 275 |
| 269 service_active_ = true; | 276 service_active_ = true; |
| 270 | 277 |
| 271 chromeos::LoginState::Get()->AddObserver(this); | 278 chromeos::LoginState::Get()->AddObserver(this); |
| 272 proximity_auth::ScreenlockBridge* screenlock_bridge = | 279 proximity_auth::ScreenlockBridge* screenlock_bridge = |
| 273 proximity_auth::ScreenlockBridge::Get(); | 280 proximity_auth::ScreenlockBridge::Get(); |
| 274 screenlock_bridge->AddObserver(this); | 281 screenlock_bridge->AddObserver(this); |
| 275 if (screenlock_bridge->focused_account_id().is_valid()) | 282 if (screenlock_bridge->focused_account_id().is_valid()) |
| 276 OnFocusedUserChanged(screenlock_bridge->focused_account_id()); | 283 OnFocusedUserChanged(screenlock_bridge->focused_account_id()); |
| 277 } | 284 } |
| 278 | 285 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 if (!account_id_.is_valid()) | 470 if (!account_id_.is_valid()) |
| 464 return nullptr; | 471 return nullptr; |
| 465 | 472 |
| 466 const auto it = user_data_.find(account_id_); | 473 const auto it = user_data_.find(account_id_); |
| 467 if (it == user_data_.end()) | 474 if (it == user_data_.end()) |
| 468 return nullptr; | 475 return nullptr; |
| 469 if (it->second->state != USER_DATA_STATE_LOADED) | 476 if (it->second->state != USER_DATA_STATE_LOADED) |
| 470 return nullptr; | 477 return nullptr; |
| 471 return it->second.get(); | 478 return it->second.get(); |
| 472 } | 479 } |
| OLD | NEW |