| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROMEOS_COMPONENTS_TETHER_TETHER_NETWORK_DISCONNECTION_HANDLER_H_ | 5 #ifndef CHROMEOS_COMPONENTS_TETHER_TETHER_NETWORK_DISCONNECTION_HANDLER_H_ |
| 6 #define CHROMEOS_COMPONENTS_TETHER_TETHER_NETWORK_DISCONNECTION_HANDLER_H_ | 6 #define CHROMEOS_COMPONENTS_TETHER_TETHER_NETWORK_DISCONNECTION_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chromeos/components/tether/active_host.h" | 9 #include "chromeos/components/tether/active_host.h" |
| 10 #include "chromeos/network/network_state_handler_observer.h" | 10 #include "chromeos/network/network_state_handler_observer.h" |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 class NetworkStateHandler; | 14 class NetworkStateHandler; |
| 15 | 15 |
| 16 namespace tether { | 16 namespace tether { |
| 17 | 17 |
| 18 class NetworkConfigurationRemover; |
| 19 |
| 18 class ActiveHost; | 20 class ActiveHost; |
| 19 | 21 |
| 20 // Handles lost Wi-Fi connections for ongoing tether sessions. When a tether | 22 // Handles lost Wi-Fi connections for ongoing tether sessions. When a tether |
| 21 // connection is in progress, the device is connected to an underlying Wi-Fi | 23 // connection is in progress, the device is connected to an underlying Wi-Fi |
| 22 // network. If the Wi-Fi connection is disrupted (e.g., by the tether host going | 24 // network. If the Wi-Fi connection is disrupted (e.g., by the tether host going |
| 23 // out of Wi-Fi range), tether metadata must be updated accordingly. This class | 25 // out of Wi-Fi range), tether metadata must be updated accordingly. This class |
| 24 // tracks ongoing connections and updates this metadata when necessary. | 26 // tracks ongoing connections and updates this metadata when necessary. |
| 25 class TetherNetworkDisconnectionHandler : public NetworkStateHandlerObserver { | 27 class TetherNetworkDisconnectionHandler : public NetworkStateHandlerObserver { |
| 26 public: | 28 public: |
| 27 TetherNetworkDisconnectionHandler(ActiveHost* active_host); | 29 TetherNetworkDisconnectionHandler( |
| 30 ActiveHost* active_host, |
| 31 NetworkStateHandler* network_state_handler, |
| 32 NetworkConfigurationRemover* network_configuration_remover); |
| 28 ~TetherNetworkDisconnectionHandler() override; | 33 ~TetherNetworkDisconnectionHandler() override; |
| 29 | 34 |
| 30 // NetworkStateHandlerObserver: | 35 // NetworkStateHandlerObserver: |
| 31 void NetworkConnectionStateChanged(const NetworkState* network) override; | 36 void NetworkConnectionStateChanged(const NetworkState* network) override; |
| 32 | 37 |
| 33 private: | 38 private: |
| 34 friend class TetherNetworkDisconnectionHandlerTest; | 39 friend class TetherNetworkDisconnectionHandlerTest; |
| 35 | 40 |
| 36 TetherNetworkDisconnectionHandler(ActiveHost* active_host, | |
| 37 NetworkStateHandler* network_state_handler); | |
| 38 | |
| 39 ActiveHost* active_host_; | 41 ActiveHost* active_host_; |
| 40 NetworkStateHandler* network_state_handler_; | 42 NetworkStateHandler* network_state_handler_; |
| 43 NetworkConfigurationRemover* network_configuration_remover_; |
| 41 | 44 |
| 42 DISALLOW_COPY_AND_ASSIGN(TetherNetworkDisconnectionHandler); | 45 DISALLOW_COPY_AND_ASSIGN(TetherNetworkDisconnectionHandler); |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace tether | 48 } // namespace tether |
| 46 | 49 |
| 47 } // namespace chromeos | 50 } // namespace chromeos |
| 48 | 51 |
| 49 #endif // CHROMEOS_COMPONENTS_TETHER_TETHER_NETWORK_DISCONNECTION_HANDLER_H_ | 52 #endif // CHROMEOS_COMPONENTS_TETHER_TETHER_NETWORK_DISCONNECTION_HANDLER_H_ |
| OLD | NEW |