| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_IMPL_CROS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_IMPL_CROS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_IMPL_CROS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_IMPL_CROS_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/chromeos/cros/network_library_impl_base.h" | 8 #include "chrome/browser/chromeos/cros/network_library_impl_base.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 virtual void RefreshIPConfig(Network* network) OVERRIDE; | 65 virtual void RefreshIPConfig(Network* network) OVERRIDE; |
| 66 | 66 |
| 67 virtual void DisconnectFromNetwork(const Network* network) OVERRIDE; | 67 virtual void DisconnectFromNetwork(const Network* network) OVERRIDE; |
| 68 virtual void CallEnableNetworkDeviceType( | 68 virtual void CallEnableNetworkDeviceType( |
| 69 ConnectionType device, bool enable) OVERRIDE; | 69 ConnectionType device, bool enable) OVERRIDE; |
| 70 virtual void CallRemoveNetwork(const Network* network) OVERRIDE; | 70 virtual void CallRemoveNetwork(const Network* network) OVERRIDE; |
| 71 | 71 |
| 72 virtual void EnableOfflineMode(bool enable) OVERRIDE; | 72 virtual void EnableOfflineMode(bool enable) OVERRIDE; |
| 73 | 73 |
| 74 virtual NetworkIPConfigVector GetIPConfigs( | 74 virtual void GetIPConfigs( |
| 75 const std::string& device_path, |
| 76 HardwareAddressFormat format, |
| 77 const NetworkGetIPConfigsCallback& callback) OVERRIDE; |
| 78 virtual NetworkIPConfigVector GetIPConfigsAndBlock( |
| 75 const std::string& device_path, | 79 const std::string& device_path, |
| 76 std::string* hardware_address, | 80 std::string* hardware_address, |
| 77 HardwareAddressFormat format) OVERRIDE; | 81 HardwareAddressFormat format) OVERRIDE; |
| 78 virtual void SetIPParameters(const std::string& service_path, | 82 virtual void SetIPParameters(const std::string& service_path, |
| 79 const std::string& address, | 83 const std::string& address, |
| 80 const std::string& netmask, | 84 const std::string& netmask, |
| 81 const std::string& gateway, | 85 const std::string& gateway, |
| 82 const std::string& name_servers, | 86 const std::string& name_servers, |
| 83 int dhcp_usage_mask) OVERRIDE; | 87 int dhcp_usage_mask) OVERRIDE; |
| 84 | 88 |
| 85 ////////////////////////////////////////////////////////////////////////////// | 89 ////////////////////////////////////////////////////////////////////////////// |
| 86 // Callbacks. | 90 // Callbacks. |
| 87 void UpdateNetworkStatus( | 91 void UpdateNetworkStatus( |
| 88 const std::string& path, const std::string& key, const Value& value); | 92 const std::string& path, const std::string& key, const Value& value); |
| 89 | 93 |
| 90 void UpdateNetworkDeviceStatus( | 94 void UpdateNetworkDeviceStatus( |
| 91 const std::string& path, const std::string& key, const Value& value); | 95 const std::string& path, const std::string& key, const Value& value); |
| 92 // Cellular specific updates. Returns false if update was ignored / reverted | 96 // Cellular specific updates. Returns false if update was ignored / reverted |
| 93 // and notification should be skipped. | 97 // and notification should be skipped. |
| 94 bool UpdateCellularDeviceStatus(NetworkDevice* device, PropertyIndex index); | 98 bool UpdateCellularDeviceStatus(NetworkDevice* device, PropertyIndex index); |
| 95 | 99 |
| 100 void GetIPConfigsCallback(const NetworkGetIPConfigsCallback& callback, |
| 101 HardwareAddressFormat format, |
| 102 const NetworkIPConfigVector& ipconfig_vector, |
| 103 const std::string& hardware_address); |
| 104 |
| 96 void PinOperationCallback(const std::string& path, | 105 void PinOperationCallback(const std::string& path, |
| 97 NetworkMethodErrorType error, | 106 NetworkMethodErrorType error, |
| 98 const std::string& error_message); | 107 const std::string& error_message); |
| 99 | 108 |
| 100 void CellularRegisterCallback(const std::string& path, | 109 void CellularRegisterCallback(const std::string& path, |
| 101 NetworkMethodErrorType error, | 110 NetworkMethodErrorType error, |
| 102 const std::string& error_message); | 111 const std::string& error_message); |
| 103 | 112 |
| 104 void NetworkConnectCallback(const std::string& service_path, | 113 void NetworkConnectCallback(const std::string& service_path, |
| 105 NetworkMethodErrorType error, | 114 NetworkMethodErrorType error, |
| 106 const std::string& error_message); | 115 const std::string& error_message); |
| 107 | 116 |
| 108 void WifiServiceUpdateAndConnect(const std::string& service_path, | 117 void WifiServiceUpdateAndConnect( |
| 109 const base::DictionaryValue* properties); | 118 const std::string& service_path, |
| 119 scoped_ptr<base::DictionaryValue> properties); |
| 110 void VPNServiceUpdateAndConnect(const std::string& service_path, | 120 void VPNServiceUpdateAndConnect(const std::string& service_path, |
| 111 const base::DictionaryValue* properties); | 121 scoped_ptr<base::DictionaryValue> properties); |
| 112 | 122 |
| 113 void NetworkManagerStatusChangedHandler(const std::string& path, | 123 void NetworkManagerStatusChangedHandler(const std::string& path, |
| 114 const std::string& key, | 124 const std::string& key, |
| 115 const base::Value& value); | 125 const base::Value& value); |
| 116 void NetworkManagerUpdate(const std::string& manager_path, | 126 void NetworkManagerUpdate(const std::string& manager_path, |
| 117 const base::DictionaryValue* properties); | 127 scoped_ptr<base::DictionaryValue> properties); |
| 118 | 128 |
| 119 void NetworkServiceUpdate(const std::string& service_path, | 129 void NetworkServiceUpdate(const std::string& service_path, |
| 120 const base::DictionaryValue* properties); | 130 scoped_ptr<base::DictionaryValue> properties); |
| 121 void RememberedNetworkServiceUpdate(const std::string& service_path, | 131 void RememberedNetworkServiceUpdate( |
| 122 const base::DictionaryValue* properties); | 132 const std::string& service_path, |
| 133 scoped_ptr<base::DictionaryValue> properties); |
| 123 void NetworkDeviceUpdate(const std::string& device_path, | 134 void NetworkDeviceUpdate(const std::string& device_path, |
| 124 const base::DictionaryValue* properties); | 135 scoped_ptr<base::DictionaryValue> properties); |
| 125 | 136 |
| 126 private: | 137 private: |
| 127 // Structure used to pass IP parameter info to a DoSetIPParameters callback, | 138 // Structure used to pass IP parameter info to a DoSetIPParameters callback, |
| 128 // since Bind only takes up to six parameters. | 139 // since Bind only takes up to six parameters. |
| 129 struct IPParameterInfo; | 140 struct IPParameterInfo; |
| 130 | 141 |
| 131 // Second half of setting IP Parameters. SetIPParameters above kicks off | 142 // Second half of setting IP Parameters. SetIPParameters above kicks off |
| 132 // an async information fetch, and this completes the operation when that | 143 // an async information fetch, and this completes the operation when that |
| 133 // fetch is complete. | 144 // fetch is complete. |
| 134 void SetIPParametersCallback(const IPParameterInfo& info, | 145 void SetIPParametersCallback(const IPParameterInfo& info, |
| 135 const std::string& service_path, | 146 const std::string& service_path, |
| 136 const base::DictionaryValue* properties); | 147 scoped_ptr<base::DictionaryValue> properties); |
| 137 | 148 |
| 138 // Second half of refreshing IPConfig for a network. Refreshes all IP config | 149 // Second half of refreshing IPConfig for a network. Refreshes all IP config |
| 139 // paths found in properties. | 150 // paths found in properties. |
| 140 void RefreshIPConfigCallback(const std::string& device_path, | 151 void RefreshIPConfigCallback(const std::string& device_path, |
| 141 const base::DictionaryValue* properties); | 152 scoped_ptr<base::DictionaryValue> properties); |
| 142 | 153 |
| 143 // This processes all Manager update messages. | 154 // This processes all Manager update messages. |
| 144 bool NetworkManagerStatusChanged(const std::string& key, const Value* value); | 155 bool NetworkManagerStatusChanged(const std::string& key, const Value* value); |
| 145 void ParseNetworkManager(const base::DictionaryValue& dict); | 156 void ParseNetworkManager(const base::DictionaryValue& dict); |
| 146 void UpdateTechnologies(const base::ListValue* technologies, int* bitfieldp); | 157 void UpdateTechnologies(const base::ListValue* technologies, int* bitfieldp); |
| 147 void UpdateAvailableTechnologies(const base::ListValue* technologies); | 158 void UpdateAvailableTechnologies(const base::ListValue* technologies); |
| 148 void UpdateEnabledTechnologies(const base::ListValue* technologies); | 159 void UpdateEnabledTechnologies(const base::ListValue* technologies); |
| 149 void UpdateConnectedTechnologies(const base::ListValue* technologies); | 160 void UpdateConnectedTechnologies(const base::ListValue* technologies); |
| 150 | 161 |
| 151 // Update network lists. | 162 // Update network lists. |
| 152 void UpdateNetworkServiceList(const base::ListValue* services); | 163 void UpdateNetworkServiceList(const base::ListValue* services); |
| 153 void UpdateWatchedNetworkServiceList(const base::ListValue* services); | 164 void UpdateWatchedNetworkServiceList(const base::ListValue* services); |
| 154 Network* ParseNetwork(const std::string& service_path, | 165 Network* ParseNetwork(const std::string& service_path, |
| 155 const base::DictionaryValue& info); | 166 const base::DictionaryValue& info); |
| 156 | 167 |
| 157 void UpdateRememberedNetworks(const base::ListValue* profiles); | 168 void UpdateRememberedNetworks(const base::ListValue* profiles); |
| 158 void RequestRememberedNetworksUpdate(); | 169 void RequestRememberedNetworksUpdate(); |
| 159 void UpdateProfile(const std::string& profile_path, | 170 void UpdateProfile(const std::string& profile_path, |
| 160 const base::DictionaryValue* properties); | 171 scoped_ptr<base::DictionaryValue> properties); |
| 161 Network* ParseRememberedNetwork(const std::string& service_path, | 172 Network* ParseRememberedNetwork(const std::string& service_path, |
| 162 const base::DictionaryValue& info); | 173 const base::DictionaryValue& info); |
| 163 | 174 |
| 164 // NetworkDevice list management functions. | 175 // NetworkDevice list management functions. |
| 165 void UpdateNetworkDeviceList(const base::ListValue* devices); | 176 void UpdateNetworkDeviceList(const base::ListValue* devices); |
| 166 void ParseNetworkDevice(const std::string& device_path, | 177 void ParseNetworkDevice(const std::string& device_path, |
| 167 const base::DictionaryValue& info); | 178 const base::DictionaryValue& info); |
| 168 | 179 |
| 169 // Empty device observer to ensure that device property updates are received. | 180 // Empty device observer to ensure that device property updates are received. |
| 170 class NetworkLibraryDeviceObserver : public NetworkDeviceObserver { | 181 class NetworkLibraryDeviceObserver : public NetworkDeviceObserver { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 192 | 203 |
| 193 // Map of monitored devices. | 204 // Map of monitored devices. |
| 194 NetworkWatcherMap monitored_devices_; | 205 NetworkWatcherMap monitored_devices_; |
| 195 | 206 |
| 196 DISALLOW_COPY_AND_ASSIGN(NetworkLibraryImplCros); | 207 DISALLOW_COPY_AND_ASSIGN(NetworkLibraryImplCros); |
| 197 }; | 208 }; |
| 198 | 209 |
| 199 } // namespace chromeos | 210 } // namespace chromeos |
| 200 | 211 |
| 201 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_IMPL_CROS_H_ | 212 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_IMPL_CROS_H_ |
| OLD | NEW |