Index: chromeos/components/tether/keep_alive_operation.h |
diff --git a/chromeos/components/tether/keep_alive_operation.h b/chromeos/components/tether/keep_alive_operation.h |
index c5099e90bd86117b78aa61ba347dd8271319b3b1..20193a84ccc06fff47a8570c633a58f1862b88f5 100644 |
--- a/chromeos/components/tether/keep_alive_operation.h |
+++ b/chromeos/components/tether/keep_alive_operation.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROMEOS_COMPONENTS_TETHER_KEEP_ALIVE_OPERATION_H_ |
#define CHROMEOS_COMPONENTS_TETHER_KEEP_ALIVE_OPERATION_H_ |
+#include "base/observer_list.h" |
#include "chromeos/components/tether/message_transfer_operation.h" |
namespace chromeos { |
@@ -14,9 +15,8 @@ namespace tether { |
class BleConnectionManager; |
// Operation which sends a keep-alive message to a tether host. |
-// TODO(khorimoto/hansberry): Consider changing protocol to receive a |
-// DeviceStatus update after sending the |
-// KeepAliveTickle message. |
+// TODO(khorimoto/hansberry): Change protocol to receive a DeviceStatus update |
+// after sending the KeepAliveTickle message. |
class KeepAliveOperation : public MessageTransferOperation { |
public: |
class Factory { |
@@ -29,13 +29,20 @@ class KeepAliveOperation : public MessageTransferOperation { |
protected: |
virtual std::unique_ptr<KeepAliveOperation> BuildInstance( |
- const cryptauth::RemoteDevice& devices_to_connect, |
+ const cryptauth::RemoteDevice& device_to_connect, |
BleConnectionManager* connection_manager); |
private: |
static Factory* factory_instance_; |
}; |
+ class Observer { |
+ public: |
+ // TODO(khorimoto): This function should take a DeviceStatus once there is |
+ // keep-alive tickle response. |
+ virtual void OnOperationFinished() = 0; |
+ }; |
+ |
KeepAliveOperation(const cryptauth::RemoteDevice& device_to_connect, |
BleConnectionManager* connection_manager); |
~KeepAliveOperation() override; |
@@ -47,11 +54,15 @@ class KeepAliveOperation : public MessageTransferOperation { |
// MessageTransferOperation: |
void OnDeviceAuthenticated( |
const cryptauth::RemoteDevice& remote_device) override; |
+ void OnOperationFinished() override; |
MessageType GetMessageTypeForConnection() override; |
private: |
friend class KeepAliveOperationTest; |
+ base::ObserverList<Observer> observer_list_; |
+ bool has_authenticated_; |
+ |
DISALLOW_COPY_AND_ASSIGN(KeepAliveOperation); |
}; |