Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/common/extensions/api/gcd_private.idl

Issue 699123004: Updated comments for gcdPrivate API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tue Nov 4 12:21:41 PST 2014 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // |commands| : Array of commands described at 76 // |commands| : Array of commands described at
77 // https://developers.google.com/cloud-devices/v1/reference/commands 77 // https://developers.google.com/cloud-devices/v1/reference/commands
78 // TODO(vitalybuka): consider to describe object in IDL. 78 // TODO(vitalybuka): consider to describe object in IDL.
79 callback CommandListCallback = void(object[] commands); 79 callback CommandListCallback = void(object[] commands);
80 80
81 // Generic callback for session calls, with status only. 81 // Generic callback for session calls, with status only.
82 callback SessionCallback = void(Status status); 82 callback SessionCallback = void(Status status);
83 83
84 // Called when device starts to establish a secure session. 84 // Called when device starts to establish a secure session.
85 // If |status| is |success| app should vall |startPairing|. 85 // If |status| is |success| app should call |startPairing|.
86 // |sessionId| is the session ID (identifies the session for future calls). 86 // |sessionId| : The session ID (identifies the session for future calls).
87 // |status| is the status (success or type of error). 87 // |status| : The status of operation (success or type of error).
88 // |pairingTypes| is the list of supported pairing types. 88 // |pairingTypes| is the list of supported pairing types.
89 callback EstablishSessionCallback = void(long sessionId, 89 callback EstablishSessionCallback = void(long sessionId,
90 Status status, 90 Status status,
91 PairingType[] pairingTypes); 91 PairingType[] pairingTypes);
92 92
93 // Called when the response to the message sent is available or on error. 93 // Called when the response to the message sent is available or on error.
94 // |status| is the status (success or type of error) 94 // |status| : The status of operation (success or type of error).
95 // |response| is the response object or null on error 95 // |response| : The response object or null on some error.
96 callback SendMessageCallback = void(Status status, 96 callback SendMessageCallback = void(Status status,
97 object response); 97 object response);
98 98
99 // Called as a response to |prefetchWifiPassword| 99 // Called as a response to |prefetchWifiPassword|
100 // |success| Denotes whether the password fetch has succeeded or failed. 100 // |success| : Denotes whether the password fetch has succeeded or failed.
101 callback SuccessCallback = void(boolean success); 101 callback SuccessCallback = void(boolean success);
102 102
103 // Called as a response to |getPrefetchedWifiNameList| 103 // Called as a response to |getPrefetchedWifiNameList|
104 // |list| the list of ssids for which wifi passwords were prefetched. 104 // |networks| : The list of ssids for which wifi passwords were prefetched.
105 callback SSIDListCallback = void(DOMString[] networks); 105 callback SSIDListCallback = void(DOMString[] networks);
106 106
107 interface Functions { 107 interface Functions {
108 // Returns the list of cloud devices visible locally or available in the 108 // Returns the list of cloud devices visible locally or available in the
109 // cloud for user account. 109 // cloud for user account.
110 static void getCloudDeviceList(CloudDeviceListCallback callback); 110 static void getCloudDeviceList(CloudDeviceListCallback callback);
111 111
112 // Queries network for local devices. Triggers an onDeviceStateChanged and 112 // Queries network for local devices. Triggers an onDeviceStateChanged and
113 // onDeviceRemoved events. Call this function *only* after registering for 113 // onDeviceRemoved events. Call this function *only* after registering for
114 // onDeviceStateChanged and onDeviceRemoved events, or it will do nothing. 114 // onDeviceStateChanged and onDeviceRemoved events, or it will do nothing.
115 static void queryForNewLocalDevices(); 115 static void queryForNewLocalDevices();
116 116
117 // Cache the WiFi password in the browser process for use during 117 // Cache the WiFi password in the browser process for use during
118 // provisioning. This is done to allow the gathering of the wifi password to 118 // provisioning. This is done to allow the gathering of the wifi password to
119 // not be done while connected to the device's network. Callback is called 119 // not be done while connected to the device's network. Callback is called
120 // with true if wifi password was cached and false if it was unavailable. 120 // with true if wifi password was cached and false if it was unavailable.
121 // |ssid| : The network to prefetch password for.
121 static void prefetchWifiPassword(DOMString ssid, SuccessCallback callback); 122 static void prefetchWifiPassword(DOMString ssid, SuccessCallback callback);
122 123
123 // Get the list of ssids with prefetched callbacks. 124 // Get the list of ssids with prefetched callbacks.
124 static void getPrefetchedWifiNameList(SSIDListCallback callback); 125 static void getPrefetchedWifiNameList(SSIDListCallback callback);
125 126
126 // Establish the session. 127 // Establish the session.
128 // |ipAddress| : The IPv4 or IPv6 address of the device.
129 // |port| : The port with Privet HTTP server.
127 static void establishSession(DOMString ipAddress, 130 static void establishSession(DOMString ipAddress,
128 long port, 131 long port,
129 EstablishSessionCallback callback); 132 EstablishSessionCallback callback);
130 133
131 // Start pairing with selected method. 134 // Start pairing with selected method. Shoulbe be called after
mednik 2014/11/04 20:27:41 Typo "shouldbe"
Vitaly Buka (NO REVIEWS) 2014/11/04 20:37:06 Done.
132 // |pairingType| is the any value provided 135 // |establishSession|.
136 // |sessionId| : The ID of the session created with |establishSession|.
137 // |pairingType| : The value selected from the list provided in
138 // callback of |establishSession|.
133 static void startPairing(long sessionId, 139 static void startPairing(long sessionId,
134 PairingType pairingType, 140 PairingType pairingType,
135 SessionCallback callback); 141 SessionCallback callback);
136 142
137 // Confirm pairing code. 143 // Confirm pairing code. Shoulbe be called after |startPairing|.
mednik 2014/11/04 20:27:42 Typo "shoulbe"
Vitaly Buka (NO REVIEWS) 2014/11/04 20:37:06 Done.
138 // |code| is the string generated by pairing process and availible to the 144 // |sessionId| : The ID of the session created with |establishSession|.
145 // |code| : The string generated by pairing process and availible to the
139 // user. 146 // user.
140 static void confirmCode(long sessionId, 147 static void confirmCode(long sessionId,
141 DOMString code, 148 DOMString code,
142 SessionCallback callback); 149 SessionCallback callback);
143 150
144 // Send an encrypted message to the device. |api| is the API path and 151 // Send an encrypted message to the device.
145 // |input| is the input object. If the message is a setup message with a 152 // If the message is a setup message with a wifi ssid specified but no
146 // wifi ssid specified but no password, the password cached from 153 // password, the password cached by |prefetchWifiPassword| will be used and
147 // |prefetchWifiPassword| will be used and the call will fail if it's not 154 // the call will fail if it's not available. For open networks use an empty
148 // available. For open networks use an empty string as the password. 155 // string as the password.
156 // |sessionId| : The ID of the session created with |establishSession|.
157 // |api| : The Privet API name to call.
158 // |input| : Input data for |api|.
149 static void sendMessage(long sessionId, 159 static void sendMessage(long sessionId,
150 DOMString api, 160 DOMString api,
151 object input, 161 object input,
152 SendMessageCallback callback); 162 SendMessageCallback callback);
153 163
154 // Terminate the session with the device. 164 // Terminate the session with the device.
165 // |sessionId| : The ID of the session created with |establishSession|.
155 static void terminateSession(long sessionId); 166 static void terminateSession(long sessionId);
156 167
157 // Returns command definitions. 168 // Returns command definitions.
158 // |deviceId| : The device to get command definitions for. 169 // |deviceId| : The device to get command definitions for.
159 // |callback| : The result callback. 170 // |callback| : The result callback.
160 static void getCommandDefinitions(DOMString deviceId, 171 static void getCommandDefinitions(DOMString deviceId,
161 CommandDefinitionsCallback callback); 172 CommandDefinitionsCallback callback);
162 173
163 // Creates and sends a new command. 174 // Creates and sends a new command.
164 // |deviceId| : The device to send the command to. 175 // |deviceId| : The device to send the command to.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Subscribe to this event to start listening new or updated devices. New 211 // Subscribe to this event to start listening new or updated devices. New
201 // listeners will get called with all known devices on the network, and 212 // listeners will get called with all known devices on the network, and
202 // status updates for devices available through the cloud. 213 // status updates for devices available through the cloud.
203 static void onDeviceStateChanged(GCDDevice device); 214 static void onDeviceStateChanged(GCDDevice device);
204 215
205 // Notifies that device has disappeared. 216 // Notifies that device has disappeared.
206 // |deviceId| : The device has disappeared. 217 // |deviceId| : The device has disappeared.
207 static void onDeviceRemoved(DOMString deviceId); 218 static void onDeviceRemoved(DOMString deviceId);
208 }; 219 };
209 }; 220 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698