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 3 // found in the LICENSE file. 4 5 // Use the <code>chrome.gcdPrivate</code> API to discover GCD APIs and register 6 // them. 7 namespace gcdPrivate { 8 9 enum SetupType { mdns, wifi, cloud }; 10 11 // Represents a GCD device discovered locally or registered to a given user. 12 dictionary GCDDevice { 13 // How this device was discovered. 14 SetupType setupType; 15 16 // Opaque device identifier to be passed to API. 17 DOMString idString; 18 19 // Cloud identifier string. 20 DOMString? cloudId; 21 22 // Device type (camera, printer, etc) 23 DOMString deviceType; 24 25 // Device human readable name 26 DOMString deviceName; 27 28 // Device human readable description 29 DOMString deviceDescription; 30 }; 31 32 callback CloudDeviceListCallback = void(GCDDevice[] devices); 33 34 interface Functions { 35 static void getCloudDeviceList(CloudDeviceListCallback callback); 36 }; 37 38 interface Events { 39 // Subscribe to this event to start listening to cloud devices. New 40 // listeners will get called with all known devices on the network. 41 static void onCloudDeviceStateChanged(boolean available, GCDDevice device); 42 }; 43 }; 44