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 start Bluetooth detection for ChromeOS since the feature is |
| 295 // only offered on ChromeOS. Enabling this on non-ChromeOS platforms |
| 296 // previously introduced a performance regression: http://crbug.com/404482 |
| 297 // Make sure not to reintroduce a performance regression if re-enabling on |
| 298 // additional platforms. |
| 299 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. |
293 bluetooth_detector_->Initialize(); | 300 bluetooth_detector_->Initialize(); |
| 301 #endif // defined(OS_CHROMEOS) |
294 } | 302 } |
295 | 303 |
296 void EasyUnlockService::LoadApp() { | 304 void EasyUnlockService::LoadApp() { |
297 DCHECK(IsAllowed()); | 305 DCHECK(IsAllowed()); |
298 | 306 |
299 #if defined(GOOGLE_CHROME_BUILD) | 307 #if defined(GOOGLE_CHROME_BUILD) |
300 base::FilePath easy_unlock_path; | 308 base::FilePath easy_unlock_path; |
301 #if defined(OS_CHROMEOS) | 309 #if defined(OS_CHROMEOS) |
302 easy_unlock_path = base::FilePath("/usr/share/chromeos-assets/easy_unlock"); | 310 easy_unlock_path = base::FilePath("/usr/share/chromeos-assets/easy_unlock"); |
303 #endif // defined(OS_CHROMEOS) | 311 #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. | 372 // Make sure lock screen state set by the extension gets reset. |
365 screenlock_state_handler_.reset(); | 373 screenlock_state_handler_.reset(); |
366 | 374 |
367 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { | 375 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { |
368 extensions::ExtensionSystem* extension_system = | 376 extensions::ExtensionSystem* extension_system = |
369 extensions::ExtensionSystem::Get(profile_); | 377 extensions::ExtensionSystem::Get(profile_); |
370 extension_system->extension_service()->ReloadExtension( | 378 extension_system->extension_service()->ReloadExtension( |
371 extension_misc::kEasyUnlockAppId); | 379 extension_misc::kEasyUnlockAppId); |
372 } | 380 } |
373 } | 381 } |
OLD | NEW |