| // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| namespace app.runtime { |
| |
| callback NullCallback = void (); |
| |
| // A WebIntents intent object. |
| [inline_doc] dictionary Intent { |
| // The WebIntent being invoked. |
| DOMString action; |
| |
| // The MIME type of the data. |
| DOMString type; |
| |
| // Data associated with the intent. |
| any data; |
| |
| // Callback to be compatible with WebIntents. |
| NullCallback postResult; |
| |
| // Callback to be compatible with WebIntents. |
| NullCallback postFailure; |
| }; |
| |
| // Optional data for the launch. |
| [inline_doc] dictionary LaunchData { |
| Intent intent; |
| }; |
| |
| interface Events { |
| static void onLaunched(optional LaunchData launchData); |
| }; |
| |
| dictionary IntentResponse { |
| // Identifies the intent. |
| long intentId; |
| |
| // Was this intent successful? (i.e., postSuccess vs postFailure). |
| boolean success; |
| |
| // Data associated with the intent response. |
| any data; |
| }; |
| |
| interface Functions { |
| // postIntentResponse is an internal method to responds to an intent |
| // previously sent to a packaged app. This is identified by intentId, and |
| // should only be invoked at most once per intentId. |
| [nodoc] static void postIntentResponse(IntentResponse intentResponse); |
| }; |
| }; |