• Cherie Cheung's avatar
    Wrapper function for ARC path conversion & sharing · 24b6c92d
    Cherie Cheung authored
    In the existing code, for Drive FS path,
    ConvertPathToArcUrl() will call guest_os::GuestOsSharePath::SharePath(),
    which in turns will call Seneschal's SharePath(). As Seneschal's
    SharePath() is an asynchronous call, it may result in a race condition.
    
    To solve this:
    1. ConvertPathToArcUrl() will return a flag to indicate if the path
    needs to be shared.
    2. ConvertToContentUrls() will return a list of paths to be shared.
    3. A new wrapper function ConvertToContentUrlsAndShare() will handle
    the path sharing after path conversion is completed.
    
    Bug: b:161427985
    Test:
    1. With FilesApp's OpenWith function (in ARC++/ARCVM), android app can open
    a Drive FS file.
    2. Intent URI can launch an android app.
    3. Chrome OS FilesApp as Android file picker works.
    4. Drag-and-drop Drive FS file to an android app can open the file.
    5. Drive FS thumbnails are showing properly.
    6. Chrome camera app can open/save file normally.
    7. Note taking android app can annotate images.
    
    Change-Id: Idfb0069b7ad2b407cf599748b766b4bf4899b7bd
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601007Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
    Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
    Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
    Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
    Commit-Queue: Cherie Cheung <cherieccy@google.com>
    Cr-Commit-Position: refs/heads/master@{#844149}
    24b6c92d
note_taking_helper_unittest.cc 64.5 KB