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

Side by Side Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 880603003: Copy Smart Lock user preferences to local state so we can access them on the sign-in screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/extensions/api/easy_unlock_private/easy_unlock_private_ api.h" 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_ api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 std::vector<linked_ptr<easy_unlock_private::UserInfo> > users; 680 std::vector<linked_ptr<easy_unlock_private::UserInfo> > users;
681 std::string user_id = service->GetUserEmail(); 681 std::string user_id = service->GetUserEmail();
682 if (!user_id.empty()) { 682 if (!user_id.empty()) {
683 users.push_back( 683 users.push_back(
684 linked_ptr<easy_unlock_private::UserInfo>( 684 linked_ptr<easy_unlock_private::UserInfo>(
685 new easy_unlock_private::UserInfo())); 685 new easy_unlock_private::UserInfo()));
686 users[0]->user_id = user_id; 686 users[0]->user_id = user_id;
687 users[0]->logged_in = service->GetType() == EasyUnlockService::TYPE_REGULAR; 687 users[0]->logged_in = service->GetType() == EasyUnlockService::TYPE_REGULAR;
688 users[0]->data_ready = users[0]->logged_in || 688 users[0]->data_ready = users[0]->logged_in ||
689 service->GetRemoteDevices() != NULL; 689 service->GetRemoteDevices() != NULL;
690
691 EasyUnlockService::UserSettings user_settings =
692 EasyUnlockService::GetUserSettings(user_id);
693 users[0]->check_close_proximity = user_settings.check_close_proximity;
690 } 694 }
691 results_ = easy_unlock_private::GetUserInfo::Results::Create(users); 695 results_ = easy_unlock_private::GetUserInfo::Results::Create(users);
692 return true; 696 return true;
693 } 697 }
694 698
695 EasyUnlockPrivateGetConnectionInfoFunction:: 699 EasyUnlockPrivateGetConnectionInfoFunction::
696 EasyUnlockPrivateGetConnectionInfoFunction() { 700 EasyUnlockPrivateGetConnectionInfoFunction() {
697 } 701 }
698 702
699 EasyUnlockPrivateGetConnectionInfoFunction:: 703 EasyUnlockPrivateGetConnectionInfoFunction::
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 scoped_ptr<base::ListValue> results(new base::ListValue()); 741 scoped_ptr<base::ListValue> results(new base::ListValue());
738 results->AppendInteger(connection_info.rssi); 742 results->AppendInteger(connection_info.rssi);
739 results->AppendInteger(connection_info.transmit_power); 743 results->AppendInteger(connection_info.transmit_power);
740 results->AppendInteger(connection_info.max_transmit_power); 744 results->AppendInteger(connection_info.max_transmit_power);
741 SetResultList(results.Pass()); 745 SetResultList(results.Pass());
742 SendResponse(true); 746 SendResponse(true);
743 } 747 }
744 748
745 } // namespace api 749 } // namespace api
746 } // namespace extensions 750 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/easy_unlock_service.h » ('j') | chrome/browser/signin/easy_unlock_service_regular.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698