Chromium Code Reviews| 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.h" | 5 #include "chrome/browser/signin/easy_unlock_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 SetTurnOffFlowStatus(IDLE); | 283 SetTurnOffFlowStatus(IDLE); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void EasyUnlockService::Initialize() { | 286 void EasyUnlockService::Initialize() { |
| 287 registrar_.Init(profile_->GetPrefs()); | 287 registrar_.Init(profile_->GetPrefs()); |
| 288 registrar_.Add( | 288 registrar_.Add( |
| 289 prefs::kEasyUnlockAllowed, | 289 prefs::kEasyUnlockAllowed, |
| 290 base::Bind(&EasyUnlockService::OnPrefsChanged, base::Unretained(this))); | 290 base::Bind(&EasyUnlockService::OnPrefsChanged, base::Unretained(this))); |
| 291 OnPrefsChanged(); | 291 OnPrefsChanged(); |
| 292 | 292 |
| 293 #if defined(OS_CHROMEOS) | |
| 294 // Only starts Bluetooth detection for ChromeOS since the feature is | |
|
Ilya Sherman
2014/08/22 01:27:19
nit: starts -> start
xiyuan
2014/08/22 03:18:56
Done.
| |
| 295 // only offered at ChromeOS. Note that http://crbug.com/404482 should be | |
|
Ilya Sherman
2014/08/22 01:27:19
nit: at -> on
xiyuan
2014/08/22 03:18:56
Done.
| |
| 296 // checked and make sure we don't regress when re-enabling this, | |
|
Ilya Sherman
2014/08/22 01:27:19
nit: "Enabling this on non-ChromeOS platforms prev
xiyuan
2014/08/22 03:18:56
Done.
| |
| 297 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. | |
| 293 bluetooth_detector_->Initialize(); | 298 bluetooth_detector_->Initialize(); |
| 299 #endif // defined(OS_CHROMEOS) | |
| 294 } | 300 } |
| 295 | 301 |
| 296 void EasyUnlockService::LoadApp() { | 302 void EasyUnlockService::LoadApp() { |
| 297 DCHECK(IsAllowed()); | 303 DCHECK(IsAllowed()); |
| 298 | 304 |
| 299 #if defined(GOOGLE_CHROME_BUILD) | 305 #if defined(GOOGLE_CHROME_BUILD) |
| 300 base::FilePath easy_unlock_path; | 306 base::FilePath easy_unlock_path; |
| 301 #if defined(OS_CHROMEOS) | 307 #if defined(OS_CHROMEOS) |
| 302 easy_unlock_path = base::FilePath("/usr/share/chromeos-assets/easy_unlock"); | 308 easy_unlock_path = base::FilePath("/usr/share/chromeos-assets/easy_unlock"); |
| 303 #endif // defined(OS_CHROMEOS) | 309 #endif // defined(OS_CHROMEOS) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 364 // Make sure lock screen state set by the extension gets reset. | 370 // Make sure lock screen state set by the extension gets reset. |
| 365 screenlock_state_handler_.reset(); | 371 screenlock_state_handler_.reset(); |
| 366 | 372 |
| 367 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { | 373 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { |
| 368 extensions::ExtensionSystem* extension_system = | 374 extensions::ExtensionSystem* extension_system = |
| 369 extensions::ExtensionSystem::Get(profile_); | 375 extensions::ExtensionSystem::Get(profile_); |
| 370 extension_system->extension_service()->ReloadExtension( | 376 extension_system->extension_service()->ReloadExtension( |
| 371 extension_misc::kEasyUnlockAppId); | 377 extension_misc::kEasyUnlockAppId); |
| 372 } | 378 } |
| 373 } | 379 } |
| OLD | NEW |