Chromium Code Reviews| 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 // DEPRECATED: Prefer ExtensionType. | 10 // DEPRECATED: Prefer ExtensionType. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 WARN, | 72 WARN, |
| 73 ERROR | 73 ERROR |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 enum ExtensionState { | 76 enum ExtensionState { |
| 77 ENABLED, | 77 ENABLED, |
| 78 DISABLED, | 78 DISABLED, |
| 79 TERMINATED | 79 TERMINATED |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 enum PermissionType { | |
|
Devlin
2015/03/16 21:35:16
This is not my favorite name, because it's a bit o
not at google - send to devlin
2015/03/16 21:48:08
I might as well reply to this comment for my API m
Devlin
2015/03/16 22:41:37
I like it. I was thinking about having the ability
| |
| 83 FILE_ACCESS, | |
| 84 INCOGNITO_ACCESS, | |
| 85 ERROR_COLLECTION, | |
| 86 RUN_ON_ALL_URLS, | |
| 87 SHOW_ACTION_BUTTON | |
| 88 }; | |
| 89 | |
| 82 dictionary AccessModifier { | 90 dictionary AccessModifier { |
| 83 boolean isEnabled; | 91 boolean isEnabled; |
| 84 boolean isActive; | 92 boolean isActive; |
| 85 }; | 93 }; |
| 86 | 94 |
| 87 dictionary StackFrame { | 95 dictionary StackFrame { |
| 88 long lineNumber; | 96 long lineNumber; |
| 89 long columnNumber; | 97 long columnNumber; |
| 90 DOMString url; | 98 DOMString url; |
| 91 DOMString functionName; | 99 DOMString functionName; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 }; | 227 }; |
| 220 | 228 |
| 221 // TODO(devlin): Combine inspect and openDevTools? | 229 // TODO(devlin): Combine inspect and openDevTools? |
| 222 dictionary InspectOptions { | 230 dictionary InspectOptions { |
| 223 DOMString extension_id; | 231 DOMString extension_id; |
| 224 (DOMString or long) render_process_id; | 232 (DOMString or long) render_process_id; |
| 225 (DOMString or long) render_view_id; | 233 (DOMString or long) render_view_id; |
| 226 boolean incognito; | 234 boolean incognito; |
| 227 }; | 235 }; |
| 228 | 236 |
| 237 dictionary SetPermissionProperties { | |
| 238 DOMString extensionId; | |
| 239 PermissionType permission; | |
| 240 boolean isActive; | |
| 241 }; | |
| 242 | |
| 229 dictionary ReloadOptions { | 243 dictionary ReloadOptions { |
| 230 // If false, an alert dialog will show in the event of a reload error. | 244 // If false, an alert dialog will show in the event of a reload error. |
| 231 // Defaults to false. | 245 // Defaults to false. |
| 232 boolean? failQuietly; | 246 boolean? failQuietly; |
| 233 }; | 247 }; |
| 234 | 248 |
| 235 dictionary LoadUnpackedOptions { | 249 dictionary LoadUnpackedOptions { |
| 236 // If false, an alert dialog will show in the event of a reload error. | 250 // If false, an alert dialog will show in the event of a reload error. |
| 237 // Defaults to false. | 251 // Defaults to false. |
| 238 boolean? failQuietly; | 252 boolean? failQuietly; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 // Opens a permissions dialog. | 404 // Opens a permissions dialog. |
| 391 // |extensionId| : The id of the extension to show permissions for. | 405 // |extensionId| : The id of the extension to show permissions for. |
| 392 static void showPermissionsDialog(DOMString extensionId, | 406 static void showPermissionsDialog(DOMString extensionId, |
| 393 optional VoidCallback callback); | 407 optional VoidCallback callback); |
| 394 | 408 |
| 395 // Opens a developer tools inspection window. | 409 // Opens a developer tools inspection window. |
| 396 // |options| : The details about the inspection. | 410 // |options| : The details about the inspection. |
| 397 static void inspect(InspectOptions options, | 411 static void inspect(InspectOptions options, |
| 398 optional VoidCallback callback); | 412 optional VoidCallback callback); |
| 399 | 413 |
| 400 // Enables / Disables file access for an extension. | |
| 401 // |extensionId| : The id of the extension to set file access for. | |
| 402 // |allow| : Whether or not to allow file access for the extension. | |
| 403 static void allowFileAccess(DOMString extensionId, | |
| 404 boolean allow, | |
| 405 optional VoidCallback callback); | |
| 406 | |
| 407 // Reloads a given extension. | 414 // Reloads a given extension. |
| 408 // |extensionId| : The id of the extension to reload. | 415 // |extensionId| : The id of the extension to reload. |
| 409 // |options| : Additional configuration parameters. | 416 // |options| : Additional configuration parameters. |
| 410 static void reload(DOMString extensionId, | 417 static void reload(DOMString extensionId, |
| 411 optional ReloadOptions options, | 418 optional ReloadOptions options, |
| 412 optional VoidCallback callback); | 419 optional VoidCallback callback); |
| 413 | 420 |
| 414 // Allows / Disallows an extension to run in incognito mode. | 421 // Sets a permission for an extension. |
| 415 // |extensionId| : The id of the extension. | 422 // |properties| : The properties to use for setting the permission. |
| 416 // |allow| : Whether or not the extension should be allowed incognito. | 423 static void setExtensionPermission(SetPermissionProperties properties, |
| 417 static void allowIncognito(DOMString extensionId, | 424 optional VoidCallback callback); |
| 418 boolean allow, | |
| 419 optional VoidCallback callback); | |
| 420 | 425 |
| 421 // Loads a user-selected unpacked item. | 426 // Loads a user-selected unpacked item. |
| 422 // |options| : Additional configuration parameters. | 427 // |options| : Additional configuration parameters. |
| 423 static void loadUnpacked(optional LoadUnpackedOptions options, | 428 static void loadUnpacked(optional LoadUnpackedOptions options, |
| 424 optional VoidCallback callback); | 429 optional VoidCallback callback); |
| 425 | 430 |
| 426 // Loads an extension / app. | 431 // Loads an extension / app. |
| 427 // |directory| : The directory to load the extension from. | 432 // |directory| : The directory to load the extension from. |
| 428 static void loadDirectory( | 433 static void loadDirectory( |
| 429 [instanceOf=DirectoryEntry] object directory, | 434 [instanceOf=DirectoryEntry] object directory, |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 459 // Open the developer tools to focus on a particular error. | 464 // Open the developer tools to focus on a particular error. |
| 460 static void openDevTools(OpenDevToolsProperties properties); | 465 static void openDevTools(OpenDevToolsProperties properties); |
| 461 }; | 466 }; |
| 462 | 467 |
| 463 interface Events { | 468 interface Events { |
| 464 // Fired when a item state is changed. | 469 // Fired when a item state is changed. |
| 465 static void onItemStateChanged(EventData response); | 470 static void onItemStateChanged(EventData response); |
| 466 }; | 471 }; |
| 467 | 472 |
| 468 }; | 473 }; |
| OLD | NEW |