OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WIFI_SYNC_WIFI_CONFIG_DELEGATE_CHROMEOS_H_ | 5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_CONFIG_DELEGATE_CHROMEOS_H_ |
6 #define COMPONENTS_WIFI_SYNC_WIFI_CONFIG_DELEGATE_CHROMEOS_H_ | 6 #define COMPONENTS_WIFI_SYNC_WIFI_CONFIG_DELEGATE_CHROMEOS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
11 #include "components/wifi_sync/wifi_config_delegate.h" | 12 #include "components/wifi_sync/wifi_config_delegate.h" |
12 | 13 |
13 namespace chromeos { | 14 namespace chromeos { |
14 class ManagedNetworkConfigurationHandler; | 15 class ManagedNetworkConfigurationHandler; |
15 } | 16 } |
16 | 17 |
17 namespace wifi_sync { | 18 namespace wifi_sync { |
18 | 19 |
19 // ChromeOS-specific implementation of the WifiConfigDelegate interface. | 20 // ChromeOS-specific implementation of the WifiConfigDelegate interface. |
20 class WifiConfigDelegateChromeOs : public WifiConfigDelegate { | 21 class WifiConfigDelegateChromeOs : public WifiConfigDelegate { |
21 public: | 22 public: |
22 // Constructs a delegate, which is responsible for applying changes | 23 // Constructs a delegate, which is responsible for applying changes |
23 // to the local network configuration. Any changes made by this | 24 // to the local network configuration. Any changes made by this |
24 // delegate will be applied to the Shill profile that corresponds to | 25 // delegate will be applied to the Shill profile that corresponds to |
25 // |user_hash|. The caller must ensure that the | 26 // |user_hash|. The caller must ensure that |
26 // |managed_net_config_handler| outlives the delegate. | 27 // |managed_net_config_handler| outlives the delegate. |
27 WifiConfigDelegateChromeOs( | 28 WifiConfigDelegateChromeOs( |
28 const std::string& user_hash, | 29 const std::string& user_hash, |
29 chromeos::ManagedNetworkConfigurationHandler* managed_net_config_handler); | 30 chromeos::ManagedNetworkConfigurationHandler* managed_net_config_handler); |
30 ~WifiConfigDelegateChromeOs() override; | 31 ~WifiConfigDelegateChromeOs() override; |
31 | 32 |
32 // WifiConfigDelegate implementation. | 33 // WifiConfigDelegate implementation. |
33 void AddToLocalNetworks(const WifiCredential& network_credential) override; | 34 void AddToLocalNetworks(const WifiCredential& network_credential) override; |
34 | 35 |
35 private: | 36 private: |
36 // The ChromeOS user-hash that should be used when modifying network | 37 // The ChromeOS user-hash that should be used when modifying network |
37 // configurations. | 38 // configurations. |
38 const std::string user_hash_; | 39 const std::string user_hash_; |
39 | 40 |
40 // The object we use to configure ChromeOS network state. | 41 // The object we use to configure ChromeOS network state. |
41 chromeos::ManagedNetworkConfigurationHandler* const | 42 chromeos::ManagedNetworkConfigurationHandler* const |
42 managed_network_configuration_handler_; | 43 managed_network_configuration_handler_; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(WifiConfigDelegateChromeOs); | 45 DISALLOW_COPY_AND_ASSIGN(WifiConfigDelegateChromeOs); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace wifi_sync | 48 } // namespace wifi_sync |
48 | 49 |
49 #endif // COMPONENTS_WIFI_SYNC_WIFI_CONFIG_DELEGATE_CHROMEOS_H_ | 50 #endif // COMPONENTS_WIFI_SYNC_WIFI_CONFIG_DELEGATE_CHROMEOS_H_ |
OLD | NEW |