Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / activity_log_private.json
blob685ac8258b2b866117cc8d3d6fe61899fc234f0d
1 // Copyright 2013 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": "activityLogPrivate",
8     "description": "none",
9     "types": [
10       {
11         "id": "ExtensionActivityType",
12         "type": "string",
13         "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request"]
14       },
15       {
16         "id": "ExtensionActivityFilter",
17         "type": "string",
18         "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request", "any"],
19         "description": "Exact match or any"
20       },
21       {
22         "id": "ExtensionActivityDomVerb",
23         "type": "string",
24         "enum": ["getter", "setter", "method", "inserted", "xhr", "webrequest", "modified"]
25       },
26       {
27         "id": "ExtensionActivity",
28         "type": "object",
29         "description": "This corresponds to a row from the ActivityLog database. Fields will be blank if they were specified precisely in a lookup filter.",
30         "properties": {
31           "activityId": {"type": "string", "optional": true, "description": "An ID of a row in the ActivityLog database that corresponds to the activity. ID is set only on activities retrieved from the database."},
32           "extensionId": {"type": "string", "optional": true},
33           "activityType": {"$ref": "ExtensionActivityType"},
34           "time": {"type": "number", "optional": true},
35           "apiCall": {"type": "string", "optional": true},
36           "args": {"type": "string", "optional": true},
37           "count": {"type": "number", "optional": true},
38           "pageUrl": {"type": "string", "optional": true},
39           "pageTitle": {"type": "string", "optional": true},
40           "argUrl": {"type": "string", "optional": true},
41           "other": {
42             "type": "object",
43             "optional": true,
44             "properties": {
45               "prerender": {"type": "boolean", "optional": true},
46               "domVerb": {"$ref": "ExtensionActivityDomVerb", "optional": true},
47               "webRequest": {"type": "string", "optional": true},
48               "extra": {"type": "string", "optional": true}
49             }
50           }
51         }
52       },
53       {
54         "id": "Filter",
55         "type": "object",
56         "description": "Used to specify values for a lookup.",
57         "properties": {
58           "extensionId": {"type": "string", "optional": true, "description": "Exact match"},
59           "activityType": {"$ref": "ExtensionActivityFilter"},
60           "apiCall": {"type": "string", "optional": true, "description": "Exact match"},
61           "pageUrl": {"type": "string", "optional": true, "description": "Treated as a prefix"},
62           "argUrl": {"type": "string", "optional": true, "description": "Treated as a prefix"},
63           "daysAgo": {"type": "integer", "optional": true, "description": "Used to lookup a precise day; today is 0"}
64         }
65       },
66       {
67         "id": "ActivityResultSet",
68         "type": "object",
69         "description": "This holds the results of a lookup, the filter of the lookup, the time of the lookup, and whether there are more results that match.",
70         "properties": {
71           "activities": {"type": "array", "items": {"$ref": "ExtensionActivity"}}
72         }
73       }
74     ],
75     "functions": [
76       {
77         "name": "getExtensionActivities",
78         "type": "function",
79         "description": "Retrieves activity from the ActivityLog that matches the specified filter.",
80         "parameters": [
81           {
82             "name": "filter",
83             "$ref": "Filter",
84             "description": "Fill out the fields that you want to search for in the database."
85           },
86           {
87             "name": "callback",
88             "type": "function",
89             "parameters": [
90               {
91                 "name": "result",
92                 "$ref": "ActivityResultSet"
93               }
94             ]
95           }
96         ]
97       },
98       {
99         "name": "deleteActivities",
100         "type": "function",
101         "description": "Deletes activities in the ActivityLog database specified in the array of activity IDs.",
102         "parameters": [
103           {
104             "name": "activityIds",
105             "type": "array",
106             "items": { "type": "string" },
107             "description": "Erases only the activities which IDs are listed in the array."
108           }
109         ]
110       },
111       {
112         "name": "deleteDatabase",
113         "type": "function",
114         "description": "Deletes the entire ActivityLog database.",
115         "parameters": []
116       },
117       {
118         "name": "deleteUrls",
119         "type": "function",
120         "description": "Delete URLs in the ActivityLog database.",
121         "parameters": [
122           {
123             "name": "urls",
124             "type": "array",
125             "items": { "type": "string" },
126             "description": "Erases only the URLs listed; if empty, erases all URLs.",
127             "optional": true
128           }
129         ]
130       }
131     ],
132     "events": [
133       {
134         "name": "onExtensionActivity",
135         "type": "function",
136         "description": "Fired when a given extension performs another activity.",
137         "parameters": [
138           {
139             "name": "activity",
140             "$ref": "ExtensionActivity"
141           }
142         ]
143       }
144     ]
145   }