| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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>chrome.gcdPrivate</code> API to discover GCD APIs and register | 5 // Use the <code>chrome.gcdPrivate</code> API to discover GCD APIs and register |
| 6 // them. | 6 // them. |
| 7 namespace gcdPrivate { | 7 namespace gcdPrivate { |
| 8 | 8 |
| 9 enum SetupType { mdns, wifi, cloud }; | 9 enum SetupType { mdns, wifi, cloud }; |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 dictionary WiFiCredentials { | 33 dictionary WiFiCredentials { |
| 34 DOMString ssid; | 34 DOMString ssid; |
| 35 DOMString password; | 35 DOMString password; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 callback CloudDeviceListCallback = void(GCDDevice[] devices); | 38 callback CloudDeviceListCallback = void(GCDDevice[] devices); |
| 39 | 39 |
| 40 interface Functions { | 40 interface Functions { |
| 41 static void getCloudDeviceList(CloudDeviceListCallback callback); | 41 static void getCloudDeviceList(CloudDeviceListCallback callback); |
| 42 | 42 |
| 43 // Call this function *only* after registering for onDeviceStateChanged | |
| 44 // events, or it will do nothing. This will trigger an | |
| 45 // onLocalDeviceStateChanged event per device. | |
| 46 static void queryForNewLocalDevices(); | |
| 47 | |
| 48 // Starts device setup process. Returns id of setup process. Id should be | 43 // Starts device setup process. Returns id of setup process. Id should be |
| 49 // used as |setupId| in all subsequent setup related calls, and for | 44 // used as |setupId| in all subsequent setup related calls, and for |
| 50 // filtering setup events. | 45 // filtering setup events. |
| 51 static long startSetup(GCDDevice device); | 46 static long startSetup(GCDDevice device); |
| 52 | 47 |
| 53 // Sets WiFi network list as reply to |onGetWifiNetworks| event. | 48 // Sets WiFi network list as reply to |onGetWifiNetworks| event. |
| 54 // |setupId| : The value returned by |startSetup|. | 49 // |setupId| : The value returned by |startSetup|. |
| 55 // |networks| : The list of network device should be registered on. | 50 // |networks| : The list of network device should be registered on. |
| 56 static void setWiFiNetworks(long setupId, DOMString[] networks); | 51 static void setWiFiNetworks(long setupId, DOMString[] networks); |
| 57 | 52 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 96 |
| 102 // Notifies app that setup is completed successfully. | 97 // Notifies app that setup is completed successfully. |
| 103 // |setupId| : The value returned by |startSetup|. | 98 // |setupId| : The value returned by |startSetup|. |
| 104 static void onSetupSuccess(long setupId); | 99 static void onSetupSuccess(long setupId); |
| 105 | 100 |
| 106 // Notifies app that setup is failed or stoped. | 101 // Notifies app that setup is failed or stoped. |
| 107 // |setupId| : The value returned by |startSetup|. | 102 // |setupId| : The value returned by |startSetup|. |
| 108 static void onSetupError(long setupId); | 103 static void onSetupError(long setupId); |
| 109 }; | 104 }; |
| 110 }; | 105 }; |
| OLD | NEW |