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 15 matching lines...) Expand all Loading... | |
26 DOMString deviceName; | 26 DOMString deviceName; |
27 | 27 |
28 // Device human readable description | 28 // Device human readable description |
29 DOMString deviceDescription; | 29 DOMString deviceDescription; |
30 }; | 30 }; |
31 | 31 |
32 callback CloudDeviceListCallback = void(GCDDevice[] devices); | 32 callback CloudDeviceListCallback = void(GCDDevice[] devices); |
33 | 33 |
34 interface Functions { | 34 interface Functions { |
35 static void getCloudDeviceList(CloudDeviceListCallback callback); | 35 static void getCloudDeviceList(CloudDeviceListCallback callback); |
36 | |
37 // Call this function *only* after registering for onLocalDeviceStateChanged | |
38 // events, or it will do nothing. This will trigger an | |
39 // onLocalDeviceStateChanged event per device. | |
asargent_no_longer_on_chrome
2014/06/24 22:31:48
Did you consider having this method take a callbac
Noam Samuel
2014/06/24 23:07:05
So registering for onLocalDeviceStateChanged cause
| |
40 static void queryForNewLocalDevices(); | |
36 }; | 41 }; |
37 | 42 |
38 interface Events { | 43 interface Events { |
39 // Subscribe to this event to start listening to cloud devices. New | 44 // Subscribe to this event to start listening to cloud devices. New |
40 // listeners will get called with all known devices on the network. | 45 // listeners will get called with all known devices on the network. |
41 static void onCloudDeviceStateChanged(boolean available, GCDDevice device); | 46 static void onLocalDeviceStateChanged(boolean available, GCDDevice device); |
42 }; | 47 }; |
43 }; | 48 }; |
OLD | NEW |