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 // Use the <code>networking.config</code> API to authenticate to captive | 5 // Use the <code>networking.config</code> API to authenticate to captive |
6 // portals. | 6 // portals. |
7 namespace networking.config { | 7 namespace networking.config { |
8 // Indicator for the type of network used in $(ref:NetworkInfo). | 8 // Indicator for the type of network used in $(ref:NetworkInfo). |
9 enum NetworkType { WiFi }; | 9 enum NetworkType { WiFi }; |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 // Called by the extension to notify the network config API that it finished | 78 // Called by the extension to notify the network config API that it finished |
79 // a captive portal authentication attempt and hand over the result of the | 79 // a captive portal authentication attempt and hand over the result of the |
80 // attempt. This function must only be called with the GUID of the latest | 80 // attempt. This function must only be called with the GUID of the latest |
81 // $(ref:onCaptivePortalDetected) event. | 81 // $(ref:onCaptivePortalDetected) event. |
82 // |GUID|: Unique network identifier obtained from | 82 // |GUID|: Unique network identifier obtained from |
83 // $(ref:onCaptivePortalDetected). | 83 // $(ref:onCaptivePortalDetected). |
84 // |result|: The result of the authentication attempt. | 84 // |result|: The result of the authentication attempt. |
85 // |callback|: Called back when this operation is finished. | 85 // |callback|: Called back when this operation is finished. |
86 void finishAuthentication(DOMString GUID, AuthenticationResult result, | 86 void finishAuthentication(DOMString GUID, AuthenticationResult result, |
87 FinishAuthenticationCallback callback); | 87 optional FinishAuthenticationCallback callback); |
88 }; | 88 }; |
89 | 89 |
90 interface Events { | 90 interface Events { |
91 // This event fires everytime a captive portal is detected on a network | 91 // This event fires everytime a captive portal is detected on a network |
92 // matching any of the currently registered network filters and the user | 92 // matching any of the currently registered network filters and the user |
93 // consents to use the extension for authentication. Network filters may be | 93 // consents to use the extension for authentication. Network filters may be |
94 // set using the $(ref:setNetworkFilter). | 94 // set using the $(ref:setNetworkFilter). |
95 // Upon receiving this event the extension should start its authentication | 95 // Upon receiving this event the extension should start its authentication |
96 // attempt with the captive portal. When the extension finishes its attempt, | 96 // attempt with the captive portal. When the extension finishes its attempt, |
97 // it must call $(ref:finishAuthentication) with the <code>GUID</code> | 97 // it must call $(ref:finishAuthentication) with the <code>GUID</code> |
98 // received with this event and the appropriate authentication result. | 98 // received with this event and the appropriate authentication result. |
99 // |networkInfo|: Information about the network on which a captive portal | 99 // |networkInfo|: Information about the network on which a captive portal |
100 // was detected. | 100 // was detected. |
101 static void onCaptivePortalDetected(NetworkInfo networkInfo); | 101 static void onCaptivePortalDetected(NetworkInfo networkInfo); |
102 }; | 102 }; |
103 }; | 103 }; |
OLD | NEW |