Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / api / developer_private.idl
blobc16f22c41ca0a043792e4c19236b8addbeae5f78
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.
5 // developerPrivate API.
6 // This is a private API exposing developing and debugging functionalities for
7 // apps and extensions.
8 namespace developerPrivate {
10 enum ItemType {
11 hosted_app,
12 packaged_app,
13 legacy_packaged_app,
14 extension,
15 theme
18 dictionary ItemInspectView {
19 // path to the inspect page.
20 DOMString path;
22 // For lazy background pages, the value is -1.
23 long render_process_id;
25 long render_view_id;
26 boolean incognito;
27 boolean generatedBackgroundPage;
30 dictionary InstallWarning {
31 DOMString message;
34 dictionary ItemInfo {
35 DOMString id;
36 DOMString name;
37 DOMString version;
38 DOMString description;
39 boolean may_disable;
40 boolean enabled;
41 DOMString? disabled_reason;
42 boolean isApp;
43 ItemType type;
44 boolean allow_activity;
45 boolean allow_file_access;
46 boolean wants_file_access;
47 boolean incognito_enabled;
48 boolean is_unpacked;
49 boolean allow_reload;
50 boolean terminated;
51 boolean allow_incognito;
52 DOMString icon_url;
54 // Path of an unpacked extension.
55 DOMString? path;
57 // Options settings page for the item.
58 DOMString? options_url;
59 DOMString? app_launch_url;
60 DOMString? homepage_url;
61 DOMString? update_url;
62 InstallWarning[] install_warnings;
63 boolean offline_enabled;
65 // All views of the current extension.
66 ItemInspectView[] views;
69 dictionary InspectOptions {
70 DOMString extension_id;
71 DOMString render_process_id;
72 DOMString render_view_id;
73 boolean incognito;
76 enum PackStatus {
77 SUCCESS,
78 ERROR,
79 WARNING
82 enum FileType {
83 LOAD,
84 PEM
87 enum SelectType {
88 FILE,
89 FOLDER
92 enum EventType {
93 INSTALLED,
94 UNINSTALLED,
95 LOADED,
96 UNLOADED,
97 // New window / view opened.
98 VIEW_REGISTERED,
99 // window / view closed.
100 VIEW_UNREGISTERED
103 dictionary PackDirectoryResponse {
104 // The response message of success or error.
105 DOMString message;
107 // Unpacked items's path.
108 DOMString item_path;
110 // Permanent key path.
111 DOMString pem_path;
113 long override_flags;
114 PackStatus status;
117 dictionary ProjectInfo {
118 DOMString name;
121 dictionary EventData {
122 EventType event_type;
123 DOMString item_id;
126 callback VoidCallback = void ();
127 callback BooleanCallback = void (boolean result);
128 callback ItemsInfoCallback = void (ItemInfo[] result);
129 callback GetStringsCallback = void (object result);
130 callback GetProjectsInfoCallback = void (ProjectInfo[] result);
131 callback PathCallback = void (DOMString path);
132 callback PackCallback = void (PackDirectoryResponse response);
133 callback VoidCallback = void();
135 interface Functions {
136 // Runs auto update for extensions and apps immediately.
137 // |callback| : Called with the boolean result, true if autoUpdate is
138 // successful.
139 static void autoUpdate(BooleanCallback callback);
141 // Returns information of all the extensions and apps installed.
142 // |include_disabled| : include disabled items.
143 // |include_terminated| : include terminated items.
144 // |callback| : Called with items info.
145 static void getItemsInfo(boolean include_disabled,
146 boolean include_terminated,
147 ItemsInfoCallback callback);
149 // Opens a permissions dialog for given |itemId|.
150 static void showPermissionsDialog(DOMString itemId,
151 optional VoidCallback callback);
153 // Opens an inspect window for given |options|
154 static void inspect(InspectOptions options,
155 optional VoidCallback callback);
157 // Enable / Disable file access for a given |item_id|
158 static void allowFileAccess(DOMString item_id,
159 boolean allow,
160 optional VoidCallback callback);
162 // Reloads a given item with |itemId|.
163 static void reload(DOMString itemId, optional VoidCallback callback);
165 // Enable / Disable a given item with id |itemId|.
166 static void enable(DOMString itemId,
167 boolean enable,
168 optional VoidCallback callback);
170 // Allow / Disallow item with |item_id| in incognito mode.
171 static void allowIncognito(DOMString item_id,
172 boolean allow,
173 VoidCallback callback);
175 // Load a user selected unpacked item
176 static void loadUnpacked(optional VoidCallback callback);
178 // Loads an extension / app from a given |directory|
179 static void loadDirectory([instanceOf=DirectoryEntry] object directory,
180 PathCallback callback);
182 // Open Dialog to browse to an entry.
183 // |select_type| : Select a file or a folder.
184 // |file_type| : Required file type. For Example pem type is for private
185 // key and load type is for an unpacked item.
186 // |callback| : called with selected item's path.
187 static void choosePath(SelectType select_type,
188 FileType file_type,
189 PathCallback callback);
191 // Pack an item with given |path| and |private_key_path|
192 // |callback| : called with the success result string.
193 static void packDirectory(DOMString path,
194 DOMString private_key_path,
195 long flags,
196 PackCallback callback);
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);
203 // Returns true if the profile is managed.
204 static void isProfileManaged(BooleanCallback callback);
207 interface Events {
208 // Fired when a item state is changed.
209 static void onItemStateChanged(EventData response);