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 COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H |
6 #define COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H | 6 #define COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 ~MessengerImpl() override; | 37 ~MessengerImpl() override; |
38 | 38 |
39 // Messenger: | 39 // Messenger: |
40 void AddObserver(MessengerObserver* observer) override; | 40 void AddObserver(MessengerObserver* observer) override; |
41 void RemoveObserver(MessengerObserver* observer) override; | 41 void RemoveObserver(MessengerObserver* observer) override; |
42 bool SupportsSignIn() const override; | 42 bool SupportsSignIn() const override; |
43 void DispatchUnlockEvent() override; | 43 void DispatchUnlockEvent() override; |
44 void RequestDecryption(const std::string& challenge) override; | 44 void RequestDecryption(const std::string& challenge) override; |
45 void RequestUnlock() override; | 45 void RequestUnlock() override; |
46 cryptauth::SecureContext* GetSecureContext() const override; | 46 cryptauth::SecureContext* GetSecureContext() const override; |
| 47 cryptauth::Connection* GetConnection() const override; |
47 | 48 |
48 // Exposed for testing. | 49 // Exposed for testing. |
49 cryptauth::Connection* connection() { return connection_.get(); } | 50 cryptauth::Connection* connection() { return connection_.get(); } |
50 | 51 |
51 private: | 52 private: |
52 // Internal data structure to represent a pending message that either hasn't | 53 // Internal data structure to represent a pending message that either hasn't |
53 // been sent yet or is waiting for a response from the remote device. | 54 // been sent yet or is waiting for a response from the remote device. |
54 struct PendingMessage { | 55 struct PendingMessage { |
55 PendingMessage(); | 56 PendingMessage(); |
56 PendingMessage(const base::DictionaryValue& message); | 57 PendingMessage(const base::DictionaryValue& message); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 std::unique_ptr<PendingMessage> pending_message_; | 120 std::unique_ptr<PendingMessage> pending_message_; |
120 | 121 |
121 base::WeakPtrFactory<MessengerImpl> weak_ptr_factory_; | 122 base::WeakPtrFactory<MessengerImpl> weak_ptr_factory_; |
122 | 123 |
123 DISALLOW_COPY_AND_ASSIGN(MessengerImpl); | 124 DISALLOW_COPY_AND_ASSIGN(MessengerImpl); |
124 }; | 125 }; |
125 | 126 |
126 } // namespace proximity_auth | 127 } // namespace proximity_auth |
127 | 128 |
128 #endif // COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H | 129 #endif // COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H |
OLD | NEW |