| Index: chrome/common/extensions/api/dial.idl
|
| diff --git a/chrome/common/extensions/api/dial.idl b/chrome/common/extensions/api/dial.idl
|
| index 3df796f1d843adcf65a74113df3b60ca9d1bc794..6506c0ec63cdffa482aaf6677ddb0c2c1d7f859f 100644
|
| --- a/chrome/common/extensions/api/dial.idl
|
| +++ b/chrome/common/extensions/api/dial.idl
|
| @@ -38,7 +38,9 @@ namespace dial {
|
|
|
| enum DialErrorCode {
|
| no_listeners,
|
| + // Deprecated. Use onNetworkIdChanged instead.
|
| no_valid_network_interfaces,
|
| + // Deprecated. Use onNetworkIdChanged instead.
|
| network_disconnected,
|
| cellular_network,
|
| socket_error,
|
| @@ -51,6 +53,7 @@ namespace dial {
|
|
|
| callback BooleanCallback = void (boolean result);
|
| callback DeviceDescriptionCallback = void (DialDeviceDescription result);
|
| + callback NetworkIdCallback = void (DOMString result);
|
|
|
| interface Functions {
|
|
|
| @@ -70,6 +73,10 @@ namespace dial {
|
| // code.
|
| static void fetchDeviceDescription(DOMString deviceLabel,
|
| DeviceDescriptionCallback callback);
|
| +
|
| + // Returns the current discovery network identifier. See the documentation
|
| + // for onNetworkIdChanged for details.
|
| + static void getNetworkId(NetworkIdCallback callback);
|
| };
|
|
|
| interface Events {
|
| @@ -87,5 +94,21 @@ namespace dial {
|
|
|
| // Event fired to inform clients on errors during device discovery.
|
| static void onError(DialError error);
|
| +
|
| + // Fired when the network being used for discovery has changed. |networkId|
|
| + // contains a short signature combining information from network interface
|
| + // and WiFi network identifiers to identify the current set of networks
|
| + // being used for discovery. This can be used by clients to clear and
|
| + // re-bootstrap device caches on a network change.
|
| + //
|
| + // |networkId| can take the following values:
|
| + // - "#XXXXXX" is a signature of the set of active networks.
|
| + // - "disconnected" means there is no active network for discovery.
|
| + // - "unknown" means there is an active network, but its signature
|
| + // cannot be determined.
|
| + //
|
| + // This event may be throttled to prevent it from firing too frequently; it
|
| + // is designed to be event-page friendly.
|
| + static void onNetworkIdChanged(DOMString networkId);
|
| };
|
| };
|
|
|