Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / echo_private.json
blobf85c3cec43bbb8760747c66d2b5735fd5882dd4c
1 // Copyright (c) 2012 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.
6   {
7     "namespace": "echoPrivate",
8     "compiler_options": {
9       "implemented_in": "chrome/browser/chromeos/extensions/echo_private_api.h"
10     },
11     "description": "none",
12     "functions": [
13       {
14         "name": "setOfferInfo",
15         "description": "Sets the offer info in Local State.",
16         "type": "function",
17         "parameters": [
18           {
19             "name": "id",
20             "type": "string",
21             "description": "The service id of the echo offer."
22           },
23           {
24             "name": "offerInfo",
25             "type": "object",
26             "additionalProperties": { "type": "any" },
27             "description": "The offer info."
28           }
29         ]
30       },
31       {
32         "name": "getOfferInfo",
33         "description": "Check in Local State for the offer info.",
34         "type": "function",
35         "parameters": [
36           {
37             "name": "id",
38             "type": "string",
39             "description": "The service id of the offer eligibility check."
40           },
41           {
42             "name": "callback",
43             "type": "function",
44             "parameters": [
45               {
46                 "name": "result",
47                 "type": "object",
48                 "additionalProperties": { "type": "any" },
49                 "description": "The returned offer info. If the offer info is not available, api will raise error."
50               }
51             ]
52           }
53         ]
54       },
55       {
56         "name": "getRegistrationCode",
57         "description": "Get the group or coupon code from underlying storage.",
58         "type": "function",
59         "parameters": [
60           {
61             "name": "type",
62             "type": "string",
63             "description": "Type of coupon code requested to be read (coupon or group)."
64           },
65           {
66             "name": "callback",
67             "type": "function",
68             "parameters": [
69               {
70                 "name": "result",
71                 "type": "string",
72                 "description" : "The coupon code."
73               }
74             ]
75           }
76         ]
77       },
78       {
79         "name": "getOobeTimestamp",
80         "description": "Get the OOBE timestamp.",
81         "type": "function",
82         "parameters": [
83           {
84             "name": "callback",
85             "type": "function",
86             "parameters": [
87               {
88                 "name": "result",
89                 "type": "string",
90                 "description" : "The OOBE timestamp."
91               }
92             ]
93           }
94         ]
95       },
96       {
97         "name": "getUserConsent",
98         "description": "If device policy allows user to redeem offer, displays a native dialog asking user for a consent to verify device's eligibility for the offer. If the device policy forbids user to redeem offers, displays a native dialog informing user the offer redeeming is disabled.",
99         "type": "function",
100         "parameters": [
101           {
102             "name": "consentRequester",
103             "description": "Information about the service requesting user consent.",
104             "type": "object",
105             "properties": {
106               "serviceName": {
107                 "type": "string",
108                 "minLength": 1,
109                 "description": "User friendly name of the service that is requesting the consent."
110               },
111               "origin": {
112                 "type": "string",
113                 "description": "URL origin of the service requesting the consent."
114               }
115             }
116           },
117           {
118             "name": "callback",
119             "type": "function",
120             "parameters": [
121               {
122                 "name": "result",
123                 "type": "boolean",
124                 "description": "Whether the user consent was given."
125               }
126             ]
127           }
128         ]
129       }
130     ]
131   }