summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/app_runtime.idl
blob: e63dc5b471b367726ce0b03b23f5c8841cfdf899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// 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. Deprecated.
  [nodoc] 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;
  };

  [inline_doc] dictionary LaunchItem {
    // FileEntry for the file.
    [instanceOf=FileEntry] object entry;

    // The MIME type of the file.
    DOMString type;
  };

  // Optional data for the launch.
  [inline_doc] dictionary LaunchData {
    [nodoc] Intent intent;

    // The id of the file handler that the app is being invoked with.
    DOMString? id;

    LaunchItem[]? items;
  };

  interface Events {
    // Fired when an app is launched from the launcher or in response to a web
    // intent.
    static void onLaunched(optional LaunchData launchData);

    // Fired at Chrome startup to apps that were running when Chrome last shut
    // down.
    static void onRestarted();
  };

  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);
  };
};