• Joel Hockey's avatar
    Support Arc, crostini, and Plugin VM in drag drop FileHelper · 54e85384
    Joel Hockey authored
    The current code in FileHelper assumes all windows are Arc. We now
    check the source and target aura::Window to detect and do the
    appropriate path translations and share files when necessary with
    crostini/pluginvm.
    
    For example, when crostini is the drag source, we will convert paths
    such as:
    
     <homedir>/file => /media/fuse/crostini_<hash>_termina_penguin/file
    
    And do the opposite translation when crostini is the drop target.
    
    We also convert paths and share files such as:
    
     <cryptohome>/MyFiles/file => /mnt/chromeos/MyFiles/file
     /media/removable/MyUSB => /mnt/chromeos/removable/MyUSB
    
    For PluginVM, the translation is
    
     <cryptohome>/MyFiles/file => //ChromeOS/MyFiles/file
     /media/removable/MyUSB => //ChromeOS/removable/MyUSB
    
    Bug: 1144138
    Change-Id: I2bb38336537acf13c4797374d6dabe6e518d689e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517346
    Commit-Queue: Joel Hockey <joelhockey@chromium.org>
    Reviewed-by: default avatarJason Lin <lxj@google.com>
    Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#827956}
    54e85384
crostini_util.cc 23.6 KB