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

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

Issue 1377313002: Revert of Hook up ProximityAuthSystem in EasyUnlockService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth_connection
Patch Set: Created 5 years, 2 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_auth_attempt.h" 5 #include "chrome/browser/signin/easy_unlock_auth_attempt.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 "chrome/browser/signin/easy_unlock_app_manager.h" 10 #include "chrome/browser/signin/easy_unlock_app_manager.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 proximity_auth::ScreenlockBridge::Get()->lock_handler()->GetAuthType( 111 proximity_auth::ScreenlockBridge::Get()->lock_handler()->GetAuthType(
112 user_id_); 112 user_id_);
113 113
114 if (auth_type != proximity_auth::ScreenlockBridge::LockHandler::USER_CLICK) { 114 if (auth_type != proximity_auth::ScreenlockBridge::LockHandler::USER_CLICK) {
115 Cancel(user_id_); 115 Cancel(user_id_);
116 return false; 116 return false;
117 } 117 }
118 118
119 state_ = STATE_RUNNING; 119 state_ = STATE_RUNNING;
120 120
121 if (!app_manager_->SendAuthAttemptEvent()) { 121 // We need this workaround for ProximityAuthBleSystem, which is already
122 // notified in EasyUnlockService. No notification is sent when only the
123 // |kEnableBluetoothLowEnergyDiscovery| flag is set, and
124 // |app_manager_->SendAuthAttemptEvent()| returns false. As a result, the auth
125 // attempt will always fail.
126 // TODO(sacomoto): Remove this when it's not needed anymore.
127 if (!app_manager_->SendAuthAttemptEvent() &&
128 !base::CommandLine::ForCurrentProcess()->HasSwitch(
129 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)) {
122 Cancel(user_id_); 130 Cancel(user_id_);
123 return false; 131 return false;
124 } 132 }
125 133
126 return true; 134 return true;
127 } 135 }
128 136
129 void EasyUnlockAuthAttempt::FinalizeUnlock(const std::string& user_id, 137 void EasyUnlockAuthAttempt::FinalizeUnlock(const std::string& user_id,
130 bool success) { 138 bool success) {
131 if (state_ != STATE_RUNNING || user_id != user_id_) 139 if (state_ != STATE_RUNNING || user_id != user_id_)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 state_ = STATE_DONE; 184 state_ = STATE_DONE;
177 } 185 }
178 186
179 void EasyUnlockAuthAttempt::Cancel(const std::string& user_id) { 187 void EasyUnlockAuthAttempt::Cancel(const std::string& user_id) {
180 state_ = STATE_DONE; 188 state_ = STATE_DONE;
181 189
182 const bool kFailure = false; 190 const bool kFailure = false;
183 finalized_callback_.Run(type_, kFailure, user_id, std::string(), 191 finalized_callback_.Run(type_, kFailure, user_id, std::string(),
184 std::string()); 192 std::string());
185 } 193 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/chrome_proximity_auth_client.cc ('k') | chrome/browser/signin/easy_unlock_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698