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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // |user_context|. | 54 // |user_context|. |
55 void GetDeviceDataList(const UserContext& user_context, | 55 void GetDeviceDataList(const UserContext& user_context, |
56 const GetDeviceDataListCallback& callback); | 56 const GetDeviceDataListCallback& callback); |
57 | 57 |
58 // Helpers to convert between DeviceData and remote device dictionary. | 58 // Helpers to convert between DeviceData and remote device dictionary. |
59 // DeviceDataToRemoteDeviceDictionary fills the remote device dictionary and | 59 // DeviceDataToRemoteDeviceDictionary fills the remote device dictionary and |
60 // always succeeds. RemoteDeviceDictionaryToDeviceData returns false if the | 60 // always succeeds. RemoteDeviceDictionaryToDeviceData returns false if the |
61 // conversion fails (missing required propery). Note that | 61 // conversion fails (missing required propery). Note that |
62 // EasyUnlockDeviceKeyData contains a sub set of the remote device dictionary. | 62 // EasyUnlockDeviceKeyData contains a sub set of the remote device dictionary. |
63 static void DeviceDataToRemoteDeviceDictionary( | 63 static void DeviceDataToRemoteDeviceDictionary( |
| 64 const std::string& user_id, |
64 const EasyUnlockDeviceKeyData& data, | 65 const EasyUnlockDeviceKeyData& data, |
65 base::DictionaryValue* dict); | 66 base::DictionaryValue* dict); |
66 static bool RemoteDeviceDictionaryToDeviceData( | 67 static bool RemoteDeviceDictionaryToDeviceData( |
67 const base::DictionaryValue& dict, | 68 const base::DictionaryValue& dict, |
68 EasyUnlockDeviceKeyData* data); | 69 EasyUnlockDeviceKeyData* data); |
69 | 70 |
70 // Helpers to convert between EasyUnlockDeviceKeyDataList and remote devices | 71 // Helpers to convert between EasyUnlockDeviceKeyDataList and remote devices |
71 // ListValue. | 72 // ListValue. |
72 static void DeviceDataListToRemoteDeviceList( | 73 static void DeviceDataListToRemoteDeviceList( |
| 74 const std::string& user_id, |
73 const EasyUnlockDeviceKeyDataList& data_list, | 75 const EasyUnlockDeviceKeyDataList& data_list, |
74 base::ListValue* device_list); | 76 base::ListValue* device_list); |
75 static bool RemoteDeviceListToDeviceDataList( | 77 static bool RemoteDeviceListToDeviceDataList( |
76 const base::ListValue& device_list, | 78 const base::ListValue& device_list, |
77 EasyUnlockDeviceKeyDataList* data_list); | 79 EasyUnlockDeviceKeyDataList* data_list); |
78 | 80 |
79 // Gets key label for the given key index. | 81 // Gets key label for the given key index. |
80 static std::string GetKeyLabel(size_t key_index); | 82 static std::string GetKeyLabel(size_t key_index); |
81 | 83 |
82 private: | 84 private: |
(...skipping 25 matching lines...) Expand all Loading... |
108 std::map<int, EasyUnlockGetKeysOperation*> get_keys_ops_; | 110 std::map<int, EasyUnlockGetKeysOperation*> get_keys_ops_; |
109 | 111 |
110 base::WeakPtrFactory<EasyUnlockKeyManager> weak_ptr_factory_; | 112 base::WeakPtrFactory<EasyUnlockKeyManager> weak_ptr_factory_; |
111 | 113 |
112 DISALLOW_COPY_AND_ASSIGN(EasyUnlockKeyManager); | 114 DISALLOW_COPY_AND_ASSIGN(EasyUnlockKeyManager); |
113 }; | 115 }; |
114 | 116 |
115 } // namespace chromeos | 117 } // namespace chromeos |
116 | 118 |
117 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 119 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
OLD | NEW |