[MD Extensions] Support drag-and-drop errors for dropped directories
Support displaying the errors dialog from drag-and-dropped directories. To do this, notify the developerPrivate API when a drag begins to cache the directory that is being dragged. Also add an additional parameter to loadUnpacked, useDraggedPath, to use the cached dragged path rather than prompting the user to choose a path or using a retryId. When the user drops the directory, use this to load the extension. Going through the loadUnpacked method like this has the advantage of displaying load errors to the user and allowing them to retry. Note that we cannot simply provide the filepath directly from the JS to the C++ for security reasons (in the case of a compromised renderer, we don't want to be able to add an arbitrary extension - this ensures that the user dragged the extension over the extensions page). The fact that the drag_and_drop_handler is also used by the non-MD version complicates this slightly, because we have to work for both versions of the code. This means there's a bit more mess than I'd otherwise like. This can be cleaned up when MD extensions launches. Bug: 788926 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I888b2094dcda1e964bca0f2680573387e714ea77 Reviewed-on: https://chromium-review.googlesource.com/809953 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by:Karan Bhatia <karandeepb@chromium.org> Reviewed-by:
Ilya Sherman <isherman@chromium.org> Reviewed-by:
Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#524125}
Showing
Please register or sign in to comment