Commit 954aab84 authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Do not accept crostini file drag until paths are mapped

M89 branch came along midway through some work, so this partially
reverts the VM file drag and drop for M88. The work will be completed in
M89.

This CL will ignore any exo file drops except from arc.

Bug: 1144138
Bug: 1146319
Change-Id: I35e2f6674976ac76d89e92253b62e26c0ae82a36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2548580
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829044}
parent a4c22f31
......@@ -7,6 +7,7 @@
#include <string>
#include <vector>
#include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/external_arc/keyboard/arc_input_method_surface_manager.h"
#include "ash/public/cpp/external_arc/message_center/arc_notification_surface_manager_impl.h"
......@@ -39,6 +40,7 @@
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/file_system_url.h"
#include "storage/common/file_system/file_system_types.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/base/dragdrop/file_info/file_info.h"
namespace {
......@@ -46,6 +48,11 @@ namespace {
constexpr char kMimeTypeArcUriList[] = "application/x-arc-uri-list";
constexpr char kUriListSeparator[] = "\r\n";
bool IsArcWindow(const aura::Window* window) {
return static_cast<ash::AppType>(window->GetProperty(
aura::client::kAppType)) == ash::AppType::ARC_APP;
}
storage::FileSystemContext* GetFileSystemContext() {
// Obtains the primary profile.
if (!user_manager::UserManager::IsInitialized())
......@@ -112,6 +119,10 @@ class ChromeFileHelper : public exo::FileHelper {
// file:///media/fuse/crostini_<hash>_termina_penguin/file.txt.
std::string lines(data.begin(), data.end());
std::vector<ui::FileInfo> filenames;
// Until we have mapping for other VMs, only accept from arc.
if (!IsArcWindow(source))
return filenames;
base::FilePath path;
storage::FileSystemURL url;
for (const base::StringPiece& line : base::SplitStringPiece(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment