| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 dictionary OpenVPNProperties { | 152 dictionary OpenVPNProperties { |
| 153 DOMString? OTP; | 153 DOMString? OTP; |
| 154 DOMString? Password; | 154 DOMString? Password; |
| 155 DOMString? UserAuthenticationType; | 155 DOMString? UserAuthenticationType; |
| 156 DOMString? Username; | 156 DOMString? Username; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 dictionary ThirdPartyVPNProperties { | 159 dictionary ThirdPartyVPNProperties { |
| 160 DOMString ExtensionID; | 160 DOMString ExtensionID; |
| 161 DOMString? Name; |
| 161 }; | 162 }; |
| 162 | 163 |
| 163 dictionary VPNConfigProperties { | 164 dictionary VPNConfigProperties { |
| 164 boolean? AutoConnect; | 165 boolean? AutoConnect; |
| 165 DOMString? Host; | 166 DOMString? Host; |
| 166 OpenVPNProperties? OpenVPN; | 167 OpenVPNProperties? OpenVPN; |
| 167 ThirdPartyVPNProperties? ThirdPartyVPN; | 168 ThirdPartyVPNProperties? ThirdPartyVPN; |
| 168 DOMString? Type; | 169 DOMString? Type; |
| 169 }; | 170 }; |
| 170 | 171 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 callback StringCallback = void(DOMString result); | 285 callback StringCallback = void(DOMString result); |
| 285 // TODO(stevenjb): Use NetworkProperties for |result| once defined. | 286 // TODO(stevenjb): Use NetworkProperties for |result| once defined. |
| 286 callback GetPropertiesCallback = void(object result); | 287 callback GetPropertiesCallback = void(object result); |
| 287 // TODO(stevenjb): Use ManagedNetworkProperties for |result| once defined. | 288 // TODO(stevenjb): Use ManagedNetworkProperties for |result| once defined. |
| 288 callback GetManagedPropertiesCallback = void(object result); | 289 callback GetManagedPropertiesCallback = void(object result); |
| 289 callback GetStatePropertiesCallback = void(NetworkStateProperties result); | 290 callback GetStatePropertiesCallback = void(NetworkStateProperties result); |
| 290 callback GetNetworksCallback = void(NetworkStateProperties[] result); | 291 callback GetNetworksCallback = void(NetworkStateProperties[] result); |
| 291 callback GetDeviceStatesCallback = void(DeviceStateProperties[] result); | 292 callback GetDeviceStatesCallback = void(DeviceStateProperties[] result); |
| 292 callback GetEnabledNetworkTypesCallback = void(NetworkType[] result); | 293 callback GetEnabledNetworkTypesCallback = void(NetworkType[] result); |
| 293 callback CaptivePortalStatusCallback = void(CaptivePortalStatus result); | 294 callback CaptivePortalStatusCallback = void(CaptivePortalStatus result); |
| 295 callback GetThirdPartyVPNProvidersCallback = |
| 296 void(ThirdPartyVPNProperties[] result); |
| 294 | 297 |
| 295 // These functions all report failures via chrome.runtime.lastError. | 298 // These functions all report failures via chrome.runtime.lastError. |
| 296 interface Functions { | 299 interface Functions { |
| 297 // Gets all the properties of the network with id networkGuid. Includes all | 300 // Gets all the properties of the network with id networkGuid. Includes all |
| 298 // properties of the network (read-only and read/write values). | 301 // properties of the network (read-only and read/write values). |
| 299 // |networkGuid|: The GUID of the network to get properties for. | 302 // |networkGuid|: The GUID of the network to get properties for. |
| 300 // |callback|: Called with the network properties when received. | 303 // |callback|: Called with the network properties when received. |
| 301 static void getProperties(DOMString networkGuid, | 304 static void getProperties(DOMString networkGuid, |
| 302 GetPropertiesCallback callback); | 305 GetPropertiesCallback callback); |
| 303 | 306 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 // the operation will fail. This will not lock the SIM; that is handled | 501 // the operation will fail. This will not lock the SIM; that is handled |
| 499 // automatically by the device. NOTE: If the SIM is locked, it must first be | 502 // automatically by the device. NOTE: If the SIM is locked, it must first be |
| 500 // unlocked with unlockCellularSim() before this can be called (otherwise it | 503 // unlocked with unlockCellularSim() before this can be called (otherwise it |
| 501 // will fail and chrome.runtime.lastError will be set to Error.SimLocked). | 504 // will fail and chrome.runtime.lastError will be set to Error.SimLocked). |
| 502 // |networkGuid|: The GUID of the cellular network to set the SIM state of. | 505 // |networkGuid|: The GUID of the cellular network to set the SIM state of. |
| 503 // |simState|: The SIM state to set. | 506 // |simState|: The SIM state to set. |
| 504 // |callback|: Called when the operation has completed. | 507 // |callback|: Called when the operation has completed. |
| 505 static void setCellularSimState(DOMString networkGuid, | 508 static void setCellularSimState(DOMString networkGuid, |
| 506 CellularSimState simState, | 509 CellularSimState simState, |
| 507 optional VoidCallback callback); | 510 optional VoidCallback callback); |
| 511 |
| 512 // Gets the list of third-party VPN providers. Each third-party VPN has |
| 513 // an associated extension ID and a descriptive name. The list may be empty. |
| 514 // |callback|: Called with the third-party VPN properties. |
| 515 static void getThirdPartyVPNProviders( |
| 516 GetThirdPartyVPNProvidersCallback callback); |
| 508 }; | 517 }; |
| 509 | 518 |
| 510 interface Events { | 519 interface Events { |
| 511 // Fired when the properties change on any of the networks. Sends a list of | 520 // Fired when the properties change on any of the networks. Sends a list of |
| 512 // GUIDs for networks whose properties have changed. | 521 // GUIDs for networks whose properties have changed. |
| 513 static void onNetworksChanged(DOMString[] changes); | 522 static void onNetworksChanged(DOMString[] changes); |
| 514 | 523 |
| 515 // Fired when the list of networks has changed. Sends a complete list of | 524 // Fired when the list of visible networks has changed. Sends a complete |
| 516 // GUIDs for all the current networks. | 525 // list of GUIDs for all visible networks. |
| 517 static void onNetworkListChanged(DOMString[] changes); | 526 static void onNetworkListChanged(DOMString[] changes); |
| 518 | 527 |
| 519 // Fired when the list of devices has changed or any device state properties | 528 // Fired when the list of devices has changed or any device state properties |
| 520 // have changed. | 529 // have changed. |
| 521 static void onDeviceStateListChanged(); | 530 static void onDeviceStateListChanged(); |
| 522 | 531 |
| 523 // Fired when a portal detection for a network completes. Sends the guid of | 532 // Fired when a portal detection for a network completes. Sends the guid of |
| 524 // the network and the corresponding captive portal status. | 533 // the network and the corresponding captive portal status. |
| 525 static void onPortalDetectionCompleted(DOMString networkGuid, | 534 static void onPortalDetectionCompleted(DOMString networkGuid, |
| 526 CaptivePortalStatus status); | 535 CaptivePortalStatus status); |
| 536 |
| 537 // Fired when the list of third-party VPN providers may have changed. Sends |
| 538 // a complete list of third-party providers. |
| 539 static void onThirdPartyVPNProvidersChanged( |
| 540 ThirdPartyVPNProperties[] providers); |
| 527 }; | 541 }; |
| 528 }; | 542 }; |
| OLD | NEW |