Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: chrome/common/extensions/api/developer_private.idl

Issue 2767173002: [MD Extensions] Respond with a load error when loading unpacked fails (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 dictionary ReloadOptions { 296 dictionary ReloadOptions {
297 // If false, an alert dialog will show in the event of a reload error. 297 // If false, an alert dialog will show in the event of a reload error.
298 // Defaults to false. 298 // Defaults to false.
299 boolean? failQuietly; 299 boolean? failQuietly;
300 }; 300 };
301 301
302 dictionary LoadUnpackedOptions { 302 dictionary LoadUnpackedOptions {
303 // If false, an alert dialog will show in the event of a reload error. 303 // If false, an alert dialog will show in the event of a reload error.
304 // Defaults to false. 304 // Defaults to false.
305 boolean? failQuietly; 305 boolean? failQuietly;
306
307 // If true, populates a LoadError for the response rather than setting
308 // lastError.
309 boolean? populateError;
306 }; 310 };
307 311
308 enum PackStatus { 312 enum PackStatus {
309 SUCCESS, 313 SUCCESS,
310 ERROR, 314 ERROR,
311 WARNING 315 WARNING
312 }; 316 };
313 317
314 enum FileType { 318 enum FileType {
315 LOAD, 319 LOAD,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 dictionary ProjectInfo { 357 dictionary ProjectInfo {
354 DOMString name; 358 DOMString name;
355 }; 359 };
356 360
357 dictionary EventData { 361 dictionary EventData {
358 EventType event_type; 362 EventType event_type;
359 DOMString item_id; 363 DOMString item_id;
360 ExtensionInfo? extensionInfo; 364 ExtensionInfo? extensionInfo;
361 }; 365 };
362 366
367 dictionary ErrorFileSource {
368 // The region before the "highlight" portion.
369 // If the region which threw the error was not found, the full contents of
370 // the file will be in the "beforeHighlight" section.
371 DOMString beforeHighlight;
372
373 // The region of the code which threw the error, and should be highlighted.
374 DOMString highlight;
375
376 // The region after the "highlight" portion.
377 DOMString afterHighlight;
378 };
379
380 dictionary LoadError {
381 // The error that occurred when trying to load the extension.
382 DOMString error;
383
384 // The path to the extension.
385 DOMString path;
386
387 // The file source for the error, if it could be retrieved.
388 ErrorFileSource? source;
389 };
390
363 dictionary RequestFileSourceProperties { 391 dictionary RequestFileSourceProperties {
364 // The ID of the extension owning the file. 392 // The ID of the extension owning the file.
365 DOMString extensionId; 393 DOMString extensionId;
366 394
367 // The path of the file, relative to the extension; e.g., manifest.json, 395 // The path of the file, relative to the extension; e.g., manifest.json,
368 // script.js, or main.html. 396 // script.js, or main.html.
369 DOMString pathSuffix; 397 DOMString pathSuffix;
370 398
371 // The error message which was thrown as a result of the error in the file. 399 // The error message which was thrown as a result of the error in the file.
372 DOMString message; 400 DOMString message;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 callback ExtensionInfosCallback = void (ExtensionInfo[] result); 465 callback ExtensionInfosCallback = void (ExtensionInfo[] result);
438 callback ExtensionInfoCallback = void (ExtensionInfo result); 466 callback ExtensionInfoCallback = void (ExtensionInfo result);
439 callback ItemsInfoCallback = void (ItemInfo[] result); 467 callback ItemsInfoCallback = void (ItemInfo[] result);
440 callback ProfileInfoCallback = void (ProfileInfo info); 468 callback ProfileInfoCallback = void (ProfileInfo info);
441 callback GetProjectsInfoCallback = void (ProjectInfo[] result); 469 callback GetProjectsInfoCallback = void (ProjectInfo[] result);
442 callback PathCallback = void (DOMString path); 470 callback PathCallback = void (DOMString path);
443 callback PackCallback = void (PackDirectoryResponse response); 471 callback PackCallback = void (PackDirectoryResponse response);
444 callback VoidCallback = void(); 472 callback VoidCallback = void();
445 callback RequestFileSourceCallback = 473 callback RequestFileSourceCallback =
446 void (RequestFileSourceResponse response); 474 void (RequestFileSourceResponse response);
475 callback LoadErrorCallback = void (optional LoadError error);
447 476
448 interface Functions { 477 interface Functions {
449 // Runs auto update for extensions and apps immediately. 478 // Runs auto update for extensions and apps immediately.
450 // |callback| : Called with the boolean result, true if autoUpdate is 479 // |callback| : Called with the boolean result, true if autoUpdate is
451 // successful. 480 // successful.
452 static void autoUpdate(optional BooleanCallback callback); 481 static void autoUpdate(optional BooleanCallback callback);
453 482
454 // Returns information of all the extensions and apps installed. 483 // Returns information of all the extensions and apps installed.
455 // |options| : Options to restrict the items returned. 484 // |options| : Options to restrict the items returned.
456 // |callback| : Called with extensions info. 485 // |callback| : Called with extensions info.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // Modifies an extension's current configuration. 525 // Modifies an extension's current configuration.
497 // |update| : The parameters for updating the extension's configuration. 526 // |update| : The parameters for updating the extension's configuration.
498 // Any properties omitted from |update| will not be changed. 527 // Any properties omitted from |update| will not be changed.
499 static void updateExtensionConfiguration( 528 static void updateExtensionConfiguration(
500 ExtensionConfigurationUpdate update, 529 ExtensionConfigurationUpdate update,
501 optional VoidCallback callback); 530 optional VoidCallback callback);
502 531
503 // Loads a user-selected unpacked item. 532 // Loads a user-selected unpacked item.
504 // |options| : Additional configuration parameters. 533 // |options| : Additional configuration parameters.
505 static void loadUnpacked(optional LoadUnpackedOptions options, 534 static void loadUnpacked(optional LoadUnpackedOptions options,
506 optional VoidCallback callback); 535 optional LoadErrorCallback callback);
507 536
508 // Loads an extension / app. 537 // Loads an extension / app.
509 // |directory| : The directory to load the extension from. 538 // |directory| : The directory to load the extension from.
510 static void loadDirectory( 539 static void loadDirectory(
511 [instanceOf=DirectoryEntry] object directory, 540 [instanceOf=DirectoryEntry] object directory,
512 PathCallback callback); 541 PathCallback callback);
513 542
514 // Open Dialog to browse to an entry. 543 // Open Dialog to browse to an entry.
515 // |selectType| : Select a file or a folder. 544 // |selectType| : Select a file or a folder.
516 // |fileType| : Required file type. For example, pem type is for private 545 // |fileType| : Required file type. For example, pem type is for private
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 620
592 interface Events { 621 interface Events {
593 // Fired when a item state is changed. 622 // Fired when a item state is changed.
594 static void onItemStateChanged(EventData response); 623 static void onItemStateChanged(EventData response);
595 624
596 // Fired when the profile's state has changed. 625 // Fired when the profile's state has changed.
597 static void onProfileStateChanged(ProfileInfo info); 626 static void onProfileStateChanged(ProfileInfo info);
598 }; 627 };
599 628
600 }; 629 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698