[Extensions API] Remove inline enums
[chromium-blink-merge.git] / chrome / common / extensions / api / omnibox.json
blob614f5ec6f080d2f0d4a46405ce0c6fe9ed56aada
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": "omnibox",
8     "description": "The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.",
9     "types": [
10       {
11         "id": "DescriptionStyleType",
12         "type": "string",
13         "description": "The style type.",
14         "enum": ["url", "match", "dim"]
15       },
16       {
17         "id": "OnInputEnteredDisposition",
18         "type": "string",
19         "enum": ["currentTab", "newForegroundTab", "newBackgroundTab"],
20         "description": "The window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab."
21       },
22       {
23         "id": "SuggestResult",
24         "type": "object",
25         "description": "A suggest result.",
26         "properties": {
27           "content": {
28             "type": "string",
29             "minLength": 1,
30             "description": "The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry."
31           },
32           "description": {
33             "type": "string",
34             "minLength": 1,
35             "description": "The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. <dim><match>dimmed match</match></dim>. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 "
36           },
37           "descriptionStyles": {
38             "nodoc": true,
39             "optional": true,
40             "type": "array",
41             "description": "An array of style ranges for the description, as provided by the extension.",
42             "items": {
43               "type": "object",
44               "name": "matchClassification",
45               "description": "The style ranges for the description, as provided by the extension.",
46               "properties": {
47                 "offset": { "type": "integer" },
48                 "type": { "description": "The style type", "$ref": "DescriptionStyleType"},
49                 "length": { "type": "integer", "optional": true }
50               }
51             }
52           },
53           "descriptionStylesRaw": {
54             "nodoc": true,
55             "optional": true,
56             "type": "array",
57             "description": "An array of style ranges for the description, as provided by ToValue().",
58             "items": {
59               "type": "object",
60               "name": "matchClassification",
61               "description": "The style ranges for the description, as provided by ToValue().",
62               "properties": {
63                 "offset": { "type": "integer" },
64                 "type": { "type": "integer" }
65               }
66             }
67           }
68         }
69       },
70       {
71         "id": "DefaultSuggestResult",
72         "inline_doc": true,
73         "type": "object",
74         "description": "A suggest result.",
75         "properties": {
76           "description": {
77             "type": "string",
78             "minLength": 1,
79             "description": "The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. <dim><match>dimmed match</match></dim>."
80           },
81           "descriptionStyles": {
82             "nodoc": true,
83             "optional": true,
84             "type": "array",
85             "description": "An array of style ranges for the description, as provided by the extension.",
86             "items": {
87               "type": "object",
88               "name": "matchClassification",
89               "description": "The style ranges for the description, as provided by the extension.",
90               "properties": {
91                 "offset": { "type": "integer" },
92                 "type": { "description": "The style type", "$ref": "DescriptionStyleType"},
93                 "length": { "type": "integer", "optional": true }
94               }
95             }
96           },
97           "descriptionStylesRaw": {
98             "nodoc": true,
99             "optional": true,
100             "type": "array",
101             "description": "An array of style ranges for the description, as provided by ToValue().",
102             "items": {
103               "type": "object",
104               "name": "matchClassification",
105               "description": "The style ranges for the description, as provided by ToValue().",
106               "properties": {
107                 "offset": { "type": "integer" },
108                 "type": { "type": "integer" }
109               }
110             }
111           }
112         }
113       }
114     ],
115     "functions": [
116       {
117         "name": "sendSuggestions",
118         "nodoc": true,
119         "type": "function",
120         "description": "A callback passed to the onInputChanged event used for sending suggestions back to the browser.",
121         "parameters": [
122           {"type": "integer", "name": "requestId"},
123           {
124             "name": "suggestResults",
125             "type": "array",
126             "description": "An array of suggest results",
127             "items": {
128               "$ref": "SuggestResult"
129             }
130           }
131         ]
132       },
133       {
134         "name": "setDefaultSuggestion",
135         "type": "function",
136         "description": "Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.",
137         "parameters": [
138           {
139             "name": "suggestion",
140             "$ref": "DefaultSuggestResult",
141             "description": "A partial SuggestResult object, without the 'content' parameter."
142           }
143         ]
144       }
145     ],
146     "events": [
147       {
148         "name": "onInputStarted",
149         "type": "function",
150         "description": "User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events.",
151         "parameters": []
152       },
153       {
154         "name": "onInputChanged",
155         "type": "function",
156         "description": "User has changed what is typed into the omnibox.",
157         "parameters": [
158           {
159             "type": "string",
160             "name": "text"
161           },
162           {
163             "name": "suggest",
164             "type": "function",
165             "description": "A callback passed to the onInputChanged event used for sending suggestions back to the browser.",
166             "parameters": [
167               {
168                 "name": "suggestResults",
169                 "type": "array",
170                 "description": "Array of suggest results",
171                 "items": {
172                   "$ref": "SuggestResult"
173                 }
174               }
175             ]
176           }
177         ]
178       },
179       {
180         "name": "onInputEntered",
181         "type": "function",
182         "description": "User has accepted what is typed into the omnibox.",
183         "parameters": [
184           {
185             "type": "string",
186             "name": "text"
187           },
188           {
189             "name": "disposition",
190             "$ref": "OnInputEnteredDisposition"
191           }
192         ]
193       },
194       {
195         "name": "onInputCancelled",
196         "type": "function",
197         "description": "User has ended the keyword input session without accepting the input.",
198         "parameters": []
199       }
200     ]
201   }