| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 static std::string GetKeyLabel(size_t key_index); | 80 static std::string GetKeyLabel(size_t key_index); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 // Returns true if there are pending operations. | 83 // Returns true if there are pending operations. |
| 84 bool HasPendingOperations() const; | 84 bool HasPendingOperations() const; |
| 85 | 85 |
| 86 // Returns the next operations id. Currently only used for get keys ops. | 86 // Returns the next operations id. Currently only used for get keys ops. |
| 87 int GetNextOperationId(); | 87 int GetNextOperationId(); |
| 88 | 88 |
| 89 // Callback invoked after create keys op. | 89 // Callback invoked after create keys op. |
| 90 void OnKeysCreated(const UserContext& user_context, | 90 void OnKeysCreated(size_t remove_start_index, |
| 91 const EasyUnlockDeviceKeyDataList& devices, | |
| 92 const RefreshKeysCallback& callback, | 91 const RefreshKeysCallback& callback, |
| 93 bool create_success); | 92 bool create_success); |
| 94 | 93 |
| 95 // Callback invoked after remove keys op. | 94 // Callback invoked after remove keys op. |
| 96 void OnKeysRemoved(const RemoveKeysCallback& callback, bool remove_success); | 95 void OnKeysRemoved(const RemoveKeysCallback& callback, bool remove_success); |
| 97 | 96 |
| 98 // Callback invoked after get keys op. | 97 // Callback invoked after get keys op. |
| 99 void OnKeysFetched(int op_id, | 98 void OnKeysFetched(int op_id, |
| 100 const GetDeviceDataListCallback& callback, | 99 const GetDeviceDataListCallback& callback, |
| 101 bool fetch_success, | 100 bool fetch_success, |
| 102 const EasyUnlockDeviceKeyDataList& fetched_data); | 101 const EasyUnlockDeviceKeyDataList& fetched_data); |
| 103 | 102 |
| 104 int operation_id_; | 103 int operation_id_; |
| 105 | 104 |
| 106 scoped_ptr<EasyUnlockCreateKeysOperation> create_keys_op_; | 105 scoped_ptr<EasyUnlockCreateKeysOperation> create_keys_op_; |
| 107 scoped_ptr<EasyUnlockRemoveKeysOperation> remove_keys_op_; | 106 scoped_ptr<EasyUnlockRemoveKeysOperation> remove_keys_op_; |
| 108 std::map<int, EasyUnlockGetKeysOperation*> get_keys_ops_; | 107 std::map<int, EasyUnlockGetKeysOperation*> get_keys_ops_; |
| 109 | 108 |
| 110 base::WeakPtrFactory<EasyUnlockKeyManager> weak_ptr_factory_; | 109 base::WeakPtrFactory<EasyUnlockKeyManager> weak_ptr_factory_; |
| 111 | 110 |
| 112 DISALLOW_COPY_AND_ASSIGN(EasyUnlockKeyManager); | 111 DISALLOW_COPY_AND_ASSIGN(EasyUnlockKeyManager); |
| 113 }; | 112 }; |
| 114 | 113 |
| 115 } // namespace chromeos | 114 } // namespace chromeos |
| 116 | 115 |
| 117 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 116 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
| OLD | NEW |