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_regular.h" | 5 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 LOG(ERROR) | 250 LOG(ERROR) |
251 << "Start auto pairing when there is another auto pairing requested."; | 251 << "Start auto pairing when there is another auto pairing requested."; |
252 callback.Run(false, std::string()); | 252 callback.Run(false, std::string()); |
253 return; | 253 return; |
254 } | 254 } |
255 | 255 |
256 auto_pairing_callback_ = callback; | 256 auto_pairing_callback_ = callback; |
257 | 257 |
258 scoped_ptr<base::ListValue> args(new base::ListValue()); | 258 scoped_ptr<base::ListValue> args(new base::ListValue()); |
259 scoped_ptr<extensions::Event> event(new extensions::Event( | 259 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 260 extensions::events::UNKNOWN, |
260 extensions::api::easy_unlock_private::OnStartAutoPairing::kEventName, | 261 extensions::api::easy_unlock_private::OnStartAutoPairing::kEventName, |
261 args.Pass())); | 262 args.Pass())); |
262 extensions::EventRouter::Get(profile())->DispatchEventWithLazyListener( | 263 extensions::EventRouter::Get(profile())->DispatchEventWithLazyListener( |
263 extension_misc::kEasyUnlockAppId, event.Pass()); | 264 extension_misc::kEasyUnlockAppId, event.Pass()); |
264 } | 265 } |
265 | 266 |
266 void EasyUnlockServiceRegular::SetAutoPairingResult( | 267 void EasyUnlockServiceRegular::SetAutoPairingResult( |
267 bool success, | 268 bool success, |
268 const std::string& error) { | 269 const std::string& error) { |
269 DCHECK(!auto_pairing_callback_.is_null()); | 270 DCHECK(!auto_pairing_callback_.is_null()); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 new base::DictionaryValue()); | 402 new base::DictionaryValue()); |
402 user_prefs_dict->SetBooleanWithoutPathExpansion( | 403 user_prefs_dict->SetBooleanWithoutPathExpansion( |
403 prefs::kEasyUnlockProximityRequired, | 404 prefs::kEasyUnlockProximityRequired, |
404 profile_prefs->GetBoolean(prefs::kEasyUnlockProximityRequired)); | 405 profile_prefs->GetBoolean(prefs::kEasyUnlockProximityRequired)); |
405 | 406 |
406 DictionaryPrefUpdate update(local_state, | 407 DictionaryPrefUpdate update(local_state, |
407 prefs::kEasyUnlockLocalStateUserPrefs); | 408 prefs::kEasyUnlockLocalStateUserPrefs); |
408 std::string user_email = GetUserEmail(); | 409 std::string user_email = GetUserEmail(); |
409 update->SetWithoutPathExpansion(user_email, user_prefs_dict.Pass()); | 410 update->SetWithoutPathExpansion(user_email, user_prefs_dict.Pass()); |
410 } | 411 } |
OLD | NEW |