OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // developerPrivate API. | 5 // developerPrivate API. |
6 // This is a private API exposing developing and debugging functionalities for | 6 // This is a private API exposing developing and debugging functionalities for |
7 // apps and extensions. | 7 // apps and extensions. |
8 namespace developerPrivate { | 8 namespace developerPrivate { |
9 | 9 |
10 enum ItemType { | 10 enum ItemType { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 // Path of an unpacked extension. | 54 // Path of an unpacked extension. |
55 DOMString? path; | 55 DOMString? path; |
56 | 56 |
57 // Options settings page for the item. | 57 // Options settings page for the item. |
58 DOMString? options_url; | 58 DOMString? options_url; |
59 DOMString? app_launch_url; | 59 DOMString? app_launch_url; |
60 DOMString? homepage_url; | 60 DOMString? homepage_url; |
61 DOMString? update_url; | 61 DOMString? update_url; |
62 InstallWarning[] install_warnings; | 62 InstallWarning[] install_warnings; |
| 63 any[] manifest_errors; |
| 64 any[] runtime_errors; |
63 boolean offline_enabled; | 65 boolean offline_enabled; |
64 | 66 |
65 // All views of the current extension. | 67 // All views of the current extension. |
66 ItemInspectView[] views; | 68 ItemInspectView[] views; |
67 }; | 69 }; |
68 | 70 |
69 dictionary InspectOptions { | 71 dictionary InspectOptions { |
70 DOMString extension_id; | 72 DOMString extension_id; |
71 DOMString render_process_id; | 73 DOMString render_process_id; |
72 DOMString render_view_id; | 74 DOMString render_view_id; |
(...skipping 17 matching lines...) Expand all Loading... |
90 }; | 92 }; |
91 | 93 |
92 enum EventType { | 94 enum EventType { |
93 INSTALLED, | 95 INSTALLED, |
94 UNINSTALLED, | 96 UNINSTALLED, |
95 LOADED, | 97 LOADED, |
96 UNLOADED, | 98 UNLOADED, |
97 // New window / view opened. | 99 // New window / view opened. |
98 VIEW_REGISTERED, | 100 VIEW_REGISTERED, |
99 // window / view closed. | 101 // window / view closed. |
100 VIEW_UNREGISTERED | 102 VIEW_UNREGISTERED, |
| 103 ERROR_ADDED |
101 }; | 104 }; |
102 | 105 |
103 dictionary PackDirectoryResponse { | 106 dictionary PackDirectoryResponse { |
104 // The response message of success or error. | 107 // The response message of success or error. |
105 DOMString message; | 108 DOMString message; |
106 | 109 |
107 // Unpacked items's path. | 110 // Unpacked items's path. |
108 DOMString item_path; | 111 DOMString item_path; |
109 | 112 |
110 // Permanent key path. | 113 // Permanent key path. |
111 DOMString pem_path; | 114 DOMString pem_path; |
112 | 115 |
113 long override_flags; | 116 long override_flags; |
114 PackStatus status; | 117 PackStatus status; |
115 }; | 118 }; |
116 | 119 |
117 dictionary ProjectInfo { | 120 dictionary ProjectInfo { |
118 DOMString name; | 121 DOMString name; |
119 }; | 122 }; |
120 | 123 |
121 dictionary EventData { | 124 dictionary EventData { |
122 EventType event_type; | 125 EventType event_type; |
123 DOMString item_id; | 126 DOMString item_id; |
124 }; | 127 }; |
125 | 128 |
126 callback VoidCallback = void (); | 129 callback VoidCallback = void (); |
127 callback BooleanCallback = void (boolean result); | 130 callback BooleanCallback = void (boolean result); |
128 callback ItemsInfoCallback = void (ItemInfo[] result); | 131 callback ItemsInfoCallback = void (ItemInfo[] result); |
129 callback GetStringsCallback = void (object result); | |
130 callback GetProjectsInfoCallback = void (ProjectInfo[] result); | 132 callback GetProjectsInfoCallback = void (ProjectInfo[] result); |
131 callback PathCallback = void (DOMString path); | 133 callback PathCallback = void (DOMString path); |
132 callback PackCallback = void (PackDirectoryResponse response); | 134 callback PackCallback = void (PackDirectoryResponse response); |
133 callback VoidCallback = void(); | 135 callback VoidCallback = void(); |
| 136 callback AnyCallback = void (any result); |
134 | 137 |
135 interface Functions { | 138 interface Functions { |
136 // Runs auto update for extensions and apps immediately. | 139 // Runs auto update for extensions and apps immediately. |
137 // |callback| : Called with the boolean result, true if autoUpdate is | 140 // |callback| : Called with the boolean result, true if autoUpdate is |
138 // successful. | 141 // successful. |
139 static void autoUpdate(BooleanCallback callback); | 142 static void autoUpdate(BooleanCallback callback); |
140 | 143 |
141 // Returns information of all the extensions and apps installed. | 144 // Returns information of all the extensions and apps installed. |
142 // |include_disabled| : include disabled items. | 145 // |include_disabled| : include disabled items. |
143 // |include_terminated| : include terminated items. | 146 // |include_terminated| : include terminated items. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 FileType file_type, | 191 FileType file_type, |
189 PathCallback callback); | 192 PathCallback callback); |
190 | 193 |
191 // Pack an item with given |path| and |private_key_path| | 194 // Pack an item with given |path| and |private_key_path| |
192 // |callback| : called with the success result string. | 195 // |callback| : called with the success result string. |
193 static void packDirectory(DOMString path, | 196 static void packDirectory(DOMString path, |
194 DOMString private_key_path, | 197 DOMString private_key_path, |
195 long flags, | 198 long flags, |
196 PackCallback callback); | 199 PackCallback callback); |
197 | 200 |
198 // Gets localized translated strings for apps_debugger. It returns the | |
199 // strings as a dictionary mapping from string identifier to the | |
200 // translated string to use in the apps_debugger app UI. | |
201 static void getStrings(GetStringsCallback callback); | |
202 | |
203 // Returns true if the profile is managed. | 201 // Returns true if the profile is managed. |
204 static void isProfileManaged(BooleanCallback callback); | 202 static void isProfileManaged(BooleanCallback callback); |
| 203 |
| 204 // Reads and returns the contents of a file related to an extension which |
| 205 // caused an error. The expected argument is a dictionary with the |
| 206 // following entries: |
| 207 // - pathSuffix: The path of the file, relative to the extension; e.g., |
| 208 // manifest.json, script.js, or main.html. |
| 209 // - extensionId: The ID of the extension owning the file. |
| 210 // - errorMessage: The error message which was thrown as a result of the |
| 211 // error in the file. |
| 212 // - manifestKey (required for "manifest.json" file): The key |
| 213 // in the manifest which caused the error (e.g., "permissions"). |
| 214 // - manifestSpecific (optional for "manifest.json" file): The specific |
| 215 // portion of the manifest key which caused the error (e.g., "foo" in |
| 216 // the "permissions" key). |
| 217 // - lineNumber (optional for non-manifest files): The line number which |
| 218 // caused the error. |
| 219 // The callback is called with a dictionary with three keys: |
| 220 // - highlight: The region of the code which threw the error, and should |
| 221 // be highlighted. |
| 222 // - beforeHighlight: The region before the "highlight" portion. |
| 223 // - afterHighlight: The region after the "highlight" portion. |
| 224 // - highlight: The region of the code which threw the error. |
| 225 // If the region which threw the error was not found, the full contents of |
| 226 // the file will be in the "beforeHighlight" section. |
| 227 static void requestFileSource(any dict, AnyCallback callback); |
| 228 |
| 229 // Open the developer tools to focus on a particular error. The expected |
| 230 // argument is a dictionary with the following entries: |
| 231 // - renderViewId: The ID of the render view in which the error occurred. |
| 232 // - renderProcessId: The ID of the process in which the error occurred. |
| 233 // - url (optional): The URL in which the error occurred. |
| 234 // - lineNumber (optional): The line to focus the devtools at. |
| 235 // - columnNumber (optional): The column to focus the devtools at. |
| 236 static void openDevTools(any dict); |
205 }; | 237 }; |
206 | 238 |
207 interface Events { | 239 interface Events { |
208 // Fired when a item state is changed. | 240 // Fired when a item state is changed. |
209 static void onItemStateChanged(EventData response); | 241 static void onItemStateChanged(EventData response); |
210 }; | 242 }; |
211 | 243 |
212 }; | 244 }; |
OLD | NEW |