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
{
18 dictionary ItemInspectView
{
19 // path to the inspect page.
22 // For lazy background pages, the value is -1.
23 long render_process_id
;
27 boolean generatedBackgroundPage
;
30 dictionary InstallWarning
{
38 DOMString description
;
41 DOMString? disabled_reason
;
44 boolean allow_activity
;
45 boolean allow_file_access
;
46 boolean wants_file_access
;
47 boolean incognito_enabled
;
51 boolean allow_incognito
;
54 // Path of an unpacked extension.
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
;
97 // New window / view opened.
99 // window / view closed.
103 dictionary PackDirectoryResponse
{
104 // The response message of success or error.
107 // Unpacked items's path.
110 // Permanent key path.
117 dictionary ProjectInfo
{
121 dictionary EventData
{
122 EventType event_type
;
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
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
,
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
,
168 optional VoidCallback
callback);
170 // Allow / Disallow item with |item_id| in incognito mode.
171 static
void allowIncognito
(DOMString item_id
,
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
,
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
,
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);
208 // Fired when a item state is changed.
209 static
void onItemStateChanged
(EventData response
);