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 | 8 |
9 namespace developerPrivate { | 9 namespace developerPrivate { |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ItemInspectView[] views; | 61 ItemInspectView[] views; |
62 }; | 62 }; |
63 | 63 |
64 dictionary InspectOptions { | 64 dictionary InspectOptions { |
65 DOMString extension_id; | 65 DOMString extension_id; |
66 DOMString render_process_id; | 66 DOMString render_process_id; |
67 DOMString render_view_id; | 67 DOMString render_view_id; |
68 boolean incognito; | 68 boolean incognito; |
69 }; | 69 }; |
70 | 70 |
| 71 enum PackStatus { |
| 72 SUCCESS, |
| 73 ERROR, |
| 74 WARNING |
| 75 }; |
| 76 |
| 77 enum FileType { |
| 78 LOAD, |
| 79 PEM |
| 80 }; |
| 81 |
| 82 enum SelectType { |
| 83 FILE, |
| 84 FOLDER |
| 85 }; |
| 86 |
| 87 dictionary PackDirectoryResponse { |
| 88 // The response message of success or error. |
| 89 DOMString message; |
| 90 |
| 91 // Unpacked items's path. |
| 92 DOMString item_path; |
| 93 |
| 94 // Permanent key path. |
| 95 DOMString pem_path; |
| 96 |
| 97 long override_flags; |
| 98 PackStatus status; |
| 99 }; |
| 100 |
71 callback BooleanCallback = void (boolean result); | 101 callback BooleanCallback = void (boolean result); |
72 callback ItemsInfoCallback = void (ItemInfo[] result); | 102 callback ItemsInfoCallback = void (ItemInfo[] result); |
73 callback GetStringsCallback = void (object result); | 103 callback GetStringsCallback = void (object result); |
| 104 callback PathCallback = void (DOMString path); |
| 105 callback PackCallback = void (PackDirectoryResponse response); |
74 | 106 |
75 interface Functions { | 107 interface Functions { |
76 // Runs auto update for extensions and apps immediately. | 108 // Runs auto update for extensions and apps immediately. |
77 // |callback| : Called with the boolean result, true if autoUpdate is | 109 // |callback| : Called with the boolean result, true if autoUpdate is |
78 // successful. | 110 // successful. |
79 static void autoUpdate(BooleanCallback callback); | 111 static void autoUpdate(BooleanCallback callback); |
80 | 112 |
81 // Returns information of all the extensions and apps installed. | 113 // Returns information of all the extensions and apps installed. |
82 // |include_disabled| : include disabled items. | 114 // |include_disabled| : include disabled items. |
83 // |include_terminated| : include terminated items. | 115 // |include_terminated| : include terminated items. |
84 // |callback| : Called with items info. | 116 // |callback| : Called with items info. |
85 static void getItemsInfo(boolean include_disabled, | 117 static void getItemsInfo(boolean include_disabled, |
86 boolean include_terminated, | 118 boolean include_terminated, |
87 ItemsInfoCallback callback); | 119 ItemsInfoCallback callback); |
88 | 120 |
89 // Opens an inspect window for given |options| | 121 // Opens an inspect window for given |options| |
90 static void inspect(InspectOptions options, | 122 static void inspect(InspectOptions options, |
91 BooleanCallback callback); | 123 BooleanCallback callback); |
92 | 124 |
93 // Enable / Disable file access for a given |itemId| | 125 // Enable / Disable file access for a given |item_id| |
94 static void allowFileAccess(DOMString itemId, | 126 static void allowFileAccess(DOMString item_id, |
95 boolean allow, | 127 boolean allow, |
96 BooleanCallback callback); | 128 BooleanCallback callback); |
97 | 129 |
98 // Reloads a given item with |itemId|. | 130 // Reloads a given item with |itemId|. |
99 static void reload(DOMString itemId, BooleanCallback callback); | 131 static void reload(DOMString itemId, BooleanCallback callback); |
100 | 132 |
101 // Enable / Disable a given item with id |itemId|. | 133 // Enable / Disable a given item with id |itemId|. |
102 static void enable(DOMString itemId, | 134 static void enable(DOMString itemId, |
103 boolean enable, | 135 boolean enable, |
104 BooleanCallback callback); | 136 BooleanCallback callback); |
105 | 137 |
106 // Load a user selected unpacked item. | 138 // Load a user selected unpacked item |
107 static void loadUnpacked(BooleanCallback callback); | 139 static void loadUnpacked(BooleanCallback callback); |
108 | 140 |
| 141 // Open Dialog to browse to an entry. |
| 142 // |select_type| : Select a file or a folder. |
| 143 // |file_type| : Required file type. For Example pem type is for private |
| 144 // key and load type is for an unpacked item. |
| 145 // |callback| : called with selected item's path. |
| 146 static void choosePath(SelectType select_type, |
| 147 FileType file_type, |
| 148 PathCallback callback); |
| 149 |
| 150 // Pack an item with given |path| and |private_key_path| |
| 151 // |callback| : called with the success result string. |
| 152 static void packDirectory(DOMString path, |
| 153 DOMString private_key_path, |
| 154 long flags, |
| 155 PackCallback callback); |
| 156 |
109 // Gets localized translated strings for apps_debugger. It returns the | 157 // Gets localized translated strings for apps_debugger. It returns the |
110 // strings as a dictionary mapping from string identifier to the | 158 // strings as a dictionary mapping from string identifier to the |
111 // translated string to use in the apps_debugger app UI. | 159 // translated string to use in the apps_debugger app UI. |
112 static void getStrings(GetStringsCallback callback); | 160 static void getStrings(GetStringsCallback callback); |
113 }; | 161 }; |
114 | 162 |
115 }; | 163 }; |
OLD | NEW |