Chromium Code Reviews| 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 // The <code>chrome.networkingPrivate</code> API is used for configuring | 5 // The <code>chrome.networkingPrivate</code> API is used for configuring |
| 6 // network connections (Cellular, Ethernet, VPN, WiFi or WiMAX). This private | 6 // network connections (Cellular, Ethernet, VPN, WiFi or WiMAX). This private |
| 7 // API is only valid if called from a browser or app associated with the | 7 // API is only valid if called from a browser or app associated with the |
| 8 // primary user. See the Open Network Configuration (ONC) documentation for | 8 // primary user. See the Open Network Configuration (ONC) documentation for |
| 9 // descriptions of properties: | 9 // descriptions of properties: |
| 10 // <a href="https://code.google.com/p/chromium/codesearch#chromium/src/component s/onc/docs/onc_spec.html"> | 10 // <a href="https://code.google.com/p/chromium/codesearch#chromium/src/component s/onc/docs/onc_spec.html"> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 enum CaptivePortalStatus { | 35 enum CaptivePortalStatus { |
| 36 Unknown, Offline, Online, Portal, ProxyAuthRequired | 36 Unknown, Offline, Online, Portal, ProxyAuthRequired |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 enum ConnectionStateType { | 39 enum ConnectionStateType { |
| 40 Connected, Connecting, NotConnected | 40 Connected, Connecting, NotConnected |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 enum DeviceStateType { | |
| 44 // Device is available but not initialized. | |
| 45 Uninitialized, | |
| 46 // Device is intialized but not enabled. | |
| 47 Disabled, | |
| 48 // Enabled state has been requested but has not completed. | |
| 49 Enabling, | |
| 50 // Device is enabled. | |
| 51 Enabled | |
| 52 }; | |
| 53 | |
| 43 enum IPConfigType { | 54 enum IPConfigType { |
| 44 DHCP, Static | 55 DHCP, Static |
| 45 }; | 56 }; |
| 46 | 57 |
| 47 enum NetworkType { | 58 enum NetworkType { |
| 48 All, Bluetooth, Cellular, Ethernet, VPN, Wireless, WiFi, WiMAX | 59 All, Cellular, Ethernet, VPN, Wireless, WiFi, WiMAX |
|
pneubeck (no reviews)
2015/04/08 10:05:07
is this related?
stevenjb
2015/04/08 20:27:30
Kind of. We never supported it, for networking, an
| |
| 49 }; | 60 }; |
| 50 | 61 |
| 51 dictionary APNProperties { | 62 dictionary APNProperties { |
| 52 DOMString? AccessPointName; | 63 DOMString? AccessPointName; |
| 53 DOMString? Language; | 64 DOMString? Language; |
| 54 DOMString? LocalizedName; | 65 DOMString? LocalizedName; |
| 55 DOMString? Name; | 66 DOMString? Name; |
| 56 DOMString? Password; | 67 DOMString? Password; |
| 57 DOMString? Username; | 68 DOMString? Username; |
| 58 }; | 69 }; |
| 59 | 70 |
| 60 dictionary CellularConfigProperties { | 71 dictionary CellularConfigProperties { |
| 61 boolean? AutoConnect; | 72 boolean? AutoConnect; |
| 62 APNProperties? APN; | 73 APNProperties? APN; |
| 63 | 74 |
| 64 // Specifies which carrier to use for Cellular configurations that support | 75 // Specifies which carrier to use for Cellular configurations that support |
| 65 // multiple carriers. May be set with $(ref:setProperties), but will be | 76 // multiple carriers. May be set with $(ref:setProperties), but will be |
| 66 // ignored by $(ref:createConfiguration). | 77 // ignored by $(ref:createConfiguration). |
| 67 DOMString? Carrier; | 78 DOMString? Carrier; |
| 68 }; | 79 }; |
| 69 | 80 |
| 70 dictionary CellularStateProperties { | 81 dictionary CellularStateProperties { |
| 71 ActivationStateType? ActivationState; | 82 ActivationStateType? ActivationState; |
| 72 DOMString? NetworkTechnology; | 83 DOMString? NetworkTechnology; |
| 73 DOMString? RoamingState; | 84 DOMString? RoamingState; |
| 74 long? SignalStrength; | 85 long? SignalStrength; |
| 75 }; | 86 }; |
| 76 | 87 |
| 88 dictionary DeviceStateProperties { | |
| 89 // The current state of the device. | |
| 90 DeviceStateType State; | |
| 91 | |
| 92 // The network type associated with the device (Cellular, Ethernet, WiFi, or | |
| 93 // WiMAX). | |
| 94 NetworkType Type; | |
| 95 }; | |
| 96 | |
| 77 dictionary EthernetStateProperties { | 97 dictionary EthernetStateProperties { |
| 78 DOMString Authentication; | 98 DOMString Authentication; |
| 79 }; | 99 }; |
| 80 | 100 |
| 81 dictionary IPConfigProperties { | 101 dictionary IPConfigProperties { |
| 82 DOMString? Gateway; | 102 DOMString? Gateway; |
| 83 DOMString? IPAddress; | 103 DOMString? IPAddress; |
| 84 DOMString[]? NameServers; | 104 DOMString[]? NameServers; |
| 85 long? RoutingPrefix; | 105 long? RoutingPrefix; |
| 86 DOMString? Type; | 106 DOMString? Type; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 | 234 |
| 215 callback VoidCallback = void(); | 235 callback VoidCallback = void(); |
| 216 callback BooleanCallback = void(boolean result); | 236 callback BooleanCallback = void(boolean result); |
| 217 callback StringCallback = void(DOMString result); | 237 callback StringCallback = void(DOMString result); |
| 218 // TODO(stevenjb): Use NetworkProperties for |result| once defined. | 238 // TODO(stevenjb): Use NetworkProperties for |result| once defined. |
| 219 callback GetPropertiesCallback = void(object result); | 239 callback GetPropertiesCallback = void(object result); |
| 220 // TODO(stevenjb): Use ManagedNetworkProperties for |result| once defined. | 240 // TODO(stevenjb): Use ManagedNetworkProperties for |result| once defined. |
| 221 callback GetManagedPropertiesCallback = void(object result); | 241 callback GetManagedPropertiesCallback = void(object result); |
| 222 callback GetStatePropertiesCallback = void(NetworkStateProperties result); | 242 callback GetStatePropertiesCallback = void(NetworkStateProperties result); |
| 223 callback GetNetworksCallback = void(NetworkStateProperties[] result); | 243 callback GetNetworksCallback = void(NetworkStateProperties[] result); |
| 244 callback GetDeviceStatesCallback = void(DeviceStateProperties[] result); | |
| 224 callback GetEnabledNetworkTypesCallback = void(NetworkType[] result); | 245 callback GetEnabledNetworkTypesCallback = void(NetworkType[] result); |
| 225 callback CaptivePortalStatusCallback = void(CaptivePortalStatus result); | 246 callback CaptivePortalStatusCallback = void(CaptivePortalStatus result); |
| 226 | 247 |
| 227 // These functions all report failures via chrome.runtime.lastError. | 248 // These functions all report failures via chrome.runtime.lastError. |
| 228 interface Functions { | 249 interface Functions { |
| 229 // Gets all the properties of the network with id networkGuid. Includes all | 250 // Gets all the properties of the network with id networkGuid. Includes all |
| 230 // properties of the network (read-only and read/write values). | 251 // properties of the network (read-only and read/write values). |
| 231 // |networkGuid|: The GUID of the network to get properties for. | 252 // |networkGuid|: The GUID of the network to get properties for. |
| 232 // |callback|: Called with the network properties when received. | 253 // |callback|: Called with the network properties when received. |
| 233 static void getProperties(DOMString networkGuid, | 254 static void getProperties(DOMString networkGuid, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 // properties when received. | 314 // properties when received. |
| 294 static void getNetworks(NetworkFilter filter, | 315 static void getNetworks(NetworkFilter filter, |
| 295 GetNetworksCallback callback); | 316 GetNetworksCallback callback); |
| 296 | 317 |
| 297 // Deprecated. Please use $(ref:networkingPrivate.getNetworks) with | 318 // Deprecated. Please use $(ref:networkingPrivate.getNetworks) with |
| 298 // filter.visible = true instead. | 319 // filter.visible = true instead. |
| 299 [deprecated="Use getNetworks."] static void getVisibleNetworks( | 320 [deprecated="Use getNetworks."] static void getVisibleNetworks( |
| 300 NetworkType networkType, | 321 NetworkType networkType, |
| 301 GetNetworksCallback callback); | 322 GetNetworksCallback callback); |
| 302 | 323 |
| 303 // Returns a list of the enabled network types. Note: this only returns | 324 // Deprecated. Please use $(ref:networkingPrivate.getDeviceStates) instead. |
| 304 // discrete types that can be enabled or disabled: Cellular, Ethernet, WiFi, | 325 [deprecated="Use getDeviceStates."] static void getEnabledNetworkTypes( |
| 305 // Wimax. | 326 GetEnabledNetworkTypesCallback callback); |
| 306 // |callback|: Called immediately with the enabled network types. | |
| 307 static void getEnabledNetworkTypes(GetEnabledNetworkTypesCallback callback); | |
| 308 | 327 |
| 309 // Enable the specified network type. Note, the type might represent | 328 // Returns a list of $(ref:networkingPrivate.DeviceStateProperties) objects. |
| 310 // multiple network types (e.g. 'Wireless'). | 329 // |callback|: Called with a dictionary of devices and their state. |
|
pneubeck (no reviews)
2015/04/08 10:05:07
dictionary -> list
stevenjb
2015/04/08 20:27:30
Done.
| |
| 330 static void getDeviceStates(GetDeviceStatesCallback callback); | |
| 331 | |
| 332 // Enables any devices matching the specified network type. Note, the type | |
| 333 // might represent multiple network types (e.g. 'Wireless'). | |
| 311 // |networkType|: The type of network to enable. | 334 // |networkType|: The type of network to enable. |
| 312 static void enableNetworkType(NetworkType networkType); | 335 static void enableNetworkType(NetworkType networkType); |
| 313 | 336 |
| 314 // Disable the specified network type. See note for | 337 // Disables any devices matching the specified network type. See note for |
| 315 // $(ref:networkingPrivate.enableNetworkType). | 338 // $(ref:networkingPrivate.enableNetworkType). |
| 316 // |networkType|: The type of network to disable. | 339 // |networkType|: The type of network to disable. |
| 317 static void disableNetworkType(NetworkType networkType); | 340 static void disableNetworkType(NetworkType networkType); |
| 318 | 341 |
| 319 // Requests that the networking subsystem scan for new networks and | 342 // Requests that the networking subsystem scan for new networks and |
| 320 // update the list returned by $(ref:getVisibleNetworks). This is only a | 343 // update the list returned by $(ref:getVisibleNetworks). This is only a |
| 321 // request: the network subsystem can choose to ignore it. If the list | 344 // request: the network subsystem can choose to ignore it. If the list |
| 322 // is updated, then the $(ref:onNetworkListChanged) event will be fired. | 345 // is updated, then the $(ref:onNetworkListChanged) event will be fired. |
| 323 static void requestNetworkScan(); | 346 static void requestNetworkScan(); |
| 324 | 347 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 // Fired when the list of networks has changed. Sends a complete list of | 436 // Fired when the list of networks has changed. Sends a complete list of |
| 414 // GUIDs for all the current networks. | 437 // GUIDs for all the current networks. |
| 415 static void onNetworkListChanged(DOMString[] changes); | 438 static void onNetworkListChanged(DOMString[] changes); |
| 416 | 439 |
| 417 // Fired when a portal detection for a network completes. Sends the guid of | 440 // Fired when a portal detection for a network completes. Sends the guid of |
| 418 // the network and the corresponding captive portal status. | 441 // the network and the corresponding captive portal status. |
| 419 static void onPortalDetectionCompleted(DOMString networkGuid, | 442 static void onPortalDetectionCompleted(DOMString networkGuid, |
| 420 CaptivePortalStatus status); | 443 CaptivePortalStatus status); |
| 421 }; | 444 }; |
| 422 }; | 445 }; |
| OLD | NEW |