| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ACTIVE_HOST_NETWORK_STATE_UPDATER_H_ | 5 #ifndef CHROMEOS_COMPONENTS_TETHER_ACTIVE_HOST_NETWORK_STATE_UPDATER_H_ |
| 6 #define CHROMEOS_COMPONENTS_TETHER_ACTIVE_HOST_NETWORK_STATE_UPDATER_H_ | 6 #define CHROMEOS_COMPONENTS_TETHER_ACTIVE_HOST_NETWORK_STATE_UPDATER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chromeos/components/tether/active_host.h" | 10 #include "chromeos/components/tether/active_host.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 // Observes changes to the status of the active host, and relays these updates | 18 // Observes changes to the status of the active host, and relays these updates |
| 19 // to the networking stack. | 19 // to the networking stack. |
| 20 class ActiveHostNetworkStateUpdater : public ActiveHost::Observer { | 20 class ActiveHostNetworkStateUpdater : public ActiveHost::Observer { |
| 21 public: | 21 public: |
| 22 ActiveHostNetworkStateUpdater(ActiveHost* active_host); | 22 ActiveHostNetworkStateUpdater(ActiveHost* active_host, |
| 23 NetworkStateHandler* network_state_handler); |
| 23 ~ActiveHostNetworkStateUpdater(); | 24 ~ActiveHostNetworkStateUpdater(); |
| 24 | 25 |
| 25 // ActiveHost::Observer: | 26 // ActiveHost::Observer: |
| 26 void OnActiveHostChanged( | 27 void OnActiveHostChanged( |
| 27 const ActiveHost::ActiveHostChangeInfo& change_info) override; | 28 const ActiveHost::ActiveHostChangeInfo& change_info) override; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 friend class ActiveHostNetworkStateUpdaterTest; | |
| 31 | |
| 32 ActiveHostNetworkStateUpdater(ActiveHost* active_host, | |
| 33 NetworkStateHandler* network_state_handler); | |
| 34 | |
| 35 ActiveHost* active_host_; | 31 ActiveHost* active_host_; |
| 36 NetworkStateHandler* network_state_handler_; | 32 NetworkStateHandler* network_state_handler_; |
| 37 | 33 |
| 38 DISALLOW_COPY_AND_ASSIGN(ActiveHostNetworkStateUpdater); | 34 DISALLOW_COPY_AND_ASSIGN(ActiveHostNetworkStateUpdater); |
| 39 }; | 35 }; |
| 40 | 36 |
| 41 } // namespace tether | 37 } // namespace tether |
| 42 | 38 |
| 43 } // namespace chromeos | 39 } // namespace chromeos |
| 44 | 40 |
| 45 #endif // CHROMEOS_COMPONENTS_TETHER_ACTIVE_HOST_NETWORK_STATE_UPDATER_H_ | 41 #endif // CHROMEOS_COMPONENTS_TETHER_ACTIVE_HOST_NETWORK_STATE_UPDATER_H_ |
| OLD | NEW |