Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 1209193003: [Proximity Auth] Create one ProximityAuthClient per profile, rather than one global one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable tests on non-ChromeOS, since there's nothing left to test on the other platforms Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "apps/app_lifetime_monitor.h" 7 #include "apps/app_lifetime_monitor.h"
8 #include "apps/app_lifetime_monitor_factory.h" 8 #include "apps/app_lifetime_monitor_factory.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 bool waking_up_; 253 bool waking_up_;
254 base::Time wake_up_time_; 254 base::Time wake_up_time_;
255 base::WeakPtrFactory<PowerMonitor> weak_ptr_factory_; 255 base::WeakPtrFactory<PowerMonitor> weak_ptr_factory_;
256 256
257 DISALLOW_COPY_AND_ASSIGN(PowerMonitor); 257 DISALLOW_COPY_AND_ASSIGN(PowerMonitor);
258 }; 258 };
259 #endif 259 #endif
260 260
261 EasyUnlockService::EasyUnlockService(Profile* profile) 261 EasyUnlockService::EasyUnlockService(Profile* profile)
262 : profile_(profile), 262 : profile_(profile),
263 proximity_auth_client_(profile),
263 bluetooth_detector_(new BluetoothDetector(this)), 264 bluetooth_detector_(new BluetoothDetector(this)),
264 shut_down_(false), 265 shut_down_(false),
265 tpm_key_checked_(false), 266 tpm_key_checked_(false),
266 weak_ptr_factory_(this) { 267 weak_ptr_factory_(this) {
267 } 268 }
268 269
269 EasyUnlockService::~EasyUnlockService() { 270 EasyUnlockService::~EasyUnlockService() {
270 } 271 }
271 272
272 // static 273 // static
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 EnsureTpmKeyPresentIfNeeded(); 688 EnsureTpmKeyPresentIfNeeded();
688 app_manager_->LoadApp(); 689 app_manager_->LoadApp();
689 NotifyUserUpdated(); 690 NotifyUserUpdated();
690 691
691 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 692 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
692 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && 693 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) &&
693 GetType() == EasyUnlockService::TYPE_REGULAR && 694 GetType() == EasyUnlockService::TYPE_REGULAR &&
694 !proximity_auth_ble_system_) { 695 !proximity_auth_ble_system_) {
695 proximity_auth_ble_system_.reset( 696 proximity_auth_ble_system_.reset(
696 new proximity_auth::ProximityAuthBleSystem( 697 new proximity_auth::ProximityAuthBleSystem(
697 GetScreenlockBridgeInstance(), profile_, 698 GetScreenlockBridgeInstance(), &proximity_auth_client_,
698 CreateCryptAuthClientFactory())); 699 CreateCryptAuthClientFactory()));
699 } 700 }
700 701
701 #if defined(OS_CHROMEOS) 702 #if defined(OS_CHROMEOS)
702 if (!power_monitor_) 703 if (!power_monitor_)
703 power_monitor_.reset(new PowerMonitor(this)); 704 power_monitor_.reset(new PowerMonitor(this));
704 #endif 705 #endif
705 } else { 706 } else {
706 bool bluetooth_waking_up = false; 707 bool bluetooth_waking_up = false;
707 #if defined(OS_CHROMEOS) 708 #if defined(OS_CHROMEOS)
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 910
910 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt 911 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt
911 // failed. 912 // failed.
912 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) 913 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_)
913 ->PrepareTpmKey(true /* check_private_key */, 914 ->PrepareTpmKey(true /* check_private_key */,
914 base::Closure()); 915 base::Closure());
915 #endif // defined(OS_CHROMEOS) 916 #endif // defined(OS_CHROMEOS)
916 917
917 tpm_key_checked_ = true; 918 tpm_key_checked_ = true;
918 } 919 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/easy_unlock_service.h ('k') | chrome/browser/signin/proximity_auth_facade.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698