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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 static void getCaptivePortalStatus(DOMString networkGuid, | 1002 static void getCaptivePortalStatus(DOMString networkGuid, |
1003 CaptivePortalStatusCallback callback); | 1003 CaptivePortalStatusCallback callback); |
1004 | 1004 |
1005 // Unlocks a Cellular SIM card. | 1005 // Unlocks a Cellular SIM card. |
1006 // * If the SIM is PIN locked, |pin| will be used to unlock the SIM and | 1006 // * If the SIM is PIN locked, |pin| will be used to unlock the SIM and |
1007 // the |puk| argument will be ignored if provided. | 1007 // the |puk| argument will be ignored if provided. |
1008 // * If the SIM is PUK locked, |puk| and |pin| must be provided. If the | 1008 // * If the SIM is PUK locked, |puk| and |pin| must be provided. If the |
1009 // operation succeeds (|puk| is valid), the PIN will be set to |pin|. | 1009 // operation succeeds (|puk| is valid), the PIN will be set to |pin|. |
1010 // (If |pin| is empty or invalid the operation will fail). | 1010 // (If |pin| is empty or invalid the operation will fail). |
1011 // |networkGuid|: The GUID of the cellular network to unlock. | 1011 // |networkGuid|: The GUID of the cellular network to unlock. |
| 1012 // If empty, the default cellular device will be used. |
1012 // |pin|: The current SIM PIN, or the new PIN if PUK is provided. | 1013 // |pin|: The current SIM PIN, or the new PIN if PUK is provided. |
1013 // |puk|: The operator provided PUK for unblocking a blocked SIM. | 1014 // |puk|: The operator provided PUK for unblocking a blocked SIM. |
1014 // |callback|: Called when the operation has completed. | 1015 // |callback|: Called when the operation has completed. |
1015 static void unlockCellularSim(DOMString networkGuid, | 1016 static void unlockCellularSim(DOMString networkGuid, |
1016 DOMString pin, | 1017 DOMString pin, |
1017 optional DOMString puk, | 1018 optional DOMString puk, |
1018 optional VoidCallback callback); | 1019 optional VoidCallback callback); |
1019 | 1020 |
1020 // Sets whether or not SIM locking is enabled (i.e a PIN will be required | 1021 // Sets whether or not SIM locking is enabled (i.e a PIN will be required |
1021 // when the device is powered) and changes the PIN if a new PIN is | 1022 // when the device is powered) and changes the PIN if a new PIN is |
1022 // specified. If the new PIN is provided but not valid (e.g. too short) | 1023 // specified. If the new PIN is provided but not valid (e.g. too short) |
1023 // the operation will fail. This will not lock the SIM; that is handled | 1024 // the operation will fail. This will not lock the SIM; that is handled |
1024 // automatically by the device. NOTE: If the SIM is locked, it must first be | 1025 // automatically by the device. NOTE: If the SIM is locked, it must first be |
1025 // unlocked with unlockCellularSim() before this can be called (otherwise it | 1026 // unlocked with unlockCellularSim() before this can be called (otherwise it |
1026 // will fail and chrome.runtime.lastError will be set to Error.SimLocked). | 1027 // will fail and chrome.runtime.lastError will be set to Error.SimLocked). |
1027 // |networkGuid|: The GUID of the cellular network to set the SIM state of. | 1028 // |networkGuid|: The GUID of the cellular network to set the SIM state of. |
| 1029 // If empty, the default cellular device will be used. |
1028 // |simState|: The SIM state to set. | 1030 // |simState|: The SIM state to set. |
1029 // |callback|: Called when the operation has completed. | 1031 // |callback|: Called when the operation has completed. |
1030 static void setCellularSimState(DOMString networkGuid, | 1032 static void setCellularSimState(DOMString networkGuid, |
1031 CellularSimState simState, | 1033 CellularSimState simState, |
1032 optional VoidCallback callback); | 1034 optional VoidCallback callback); |
1033 }; | 1035 }; |
1034 | 1036 |
1035 interface Events { | 1037 interface Events { |
1036 // Fired when the properties change on any of the networks. Sends a list of | 1038 // Fired when the properties change on any of the networks. Sends a list of |
1037 // GUIDs for networks whose properties have changed. | 1039 // GUIDs for networks whose properties have changed. |
1038 static void onNetworksChanged(DOMString[] changes); | 1040 static void onNetworksChanged(DOMString[] changes); |
1039 | 1041 |
1040 // Fired when the list of networks has changed. Sends a complete list of | 1042 // Fired when the list of networks has changed. Sends a complete list of |
1041 // GUIDs for all the current networks. | 1043 // GUIDs for all the current networks. |
1042 static void onNetworkListChanged(DOMString[] changes); | 1044 static void onNetworkListChanged(DOMString[] changes); |
1043 | 1045 |
1044 // Fired when the list of devices has changed or any device state properties | 1046 // Fired when the list of devices has changed or any device state properties |
1045 // have changed. | 1047 // have changed. |
1046 static void onDeviceStateListChanged(); | 1048 static void onDeviceStateListChanged(); |
1047 | 1049 |
1048 // Fired when a portal detection for a network completes. Sends the guid of | 1050 // Fired when a portal detection for a network completes. Sends the guid of |
1049 // the network and the corresponding captive portal status. | 1051 // the network and the corresponding captive portal status. |
1050 static void onPortalDetectionCompleted(DOMString networkGuid, | 1052 static void onPortalDetectionCompleted(DOMString networkGuid, |
1051 CaptivePortalStatus status); | 1053 CaptivePortalStatus status); |
1052 }; | 1054 }; |
1053 }; | 1055 }; |
OLD | NEW |