| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #include "chrome/browser/chromeos/file_manager/arc_file_tasks.h" | 5 #include "chrome/browser/chromeos/file_manager/arc_file_tasks.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 arc::mojom::IntentHelperInstance* arc_intent_helper = | 290 arc::mojom::IntentHelperInstance* arc_intent_helper = |
| 291 GetArcIntentHelper(profile, kArcIntentHelperVersionWithUrlListSupport); | 291 GetArcIntentHelper(profile, kArcIntentHelperVersionWithUrlListSupport); |
| 292 if (!arc_intent_helper) { | 292 if (!arc_intent_helper) { |
| 293 callback.Run(std::move(result_list)); | 293 callback.Run(std::move(result_list)); |
| 294 return; | 294 return; |
| 295 } | 295 } |
| 296 | 296 |
| 297 mojo::Array<arc::mojom::UrlWithMimeTypePtr> urls; | 297 mojo::Array<arc::mojom::UrlWithMimeTypePtr> urls; |
| 298 for (const extensions::EntryInfo& entry : entries) { | 298 for (const extensions::EntryInfo& entry : entries) { |
| 299 if (entry.is_directory) { // ARC apps don't support directories. |
| 300 callback.Run(std::move(result_list)); |
| 301 return; |
| 302 } |
| 303 |
| 299 GURL url; | 304 GURL url; |
| 300 if (!ConvertToArcUrl(entry.path, &url)) { | 305 if (!ConvertToArcUrl(entry.path, &url)) { |
| 301 callback.Run(std::move(result_list)); | 306 callback.Run(std::move(result_list)); |
| 302 return; | 307 return; |
| 303 } | 308 } |
| 304 | 309 |
| 305 arc::mojom::UrlWithMimeTypePtr url_with_type = | 310 arc::mojom::UrlWithMimeTypePtr url_with_type = |
| 306 arc::mojom::UrlWithMimeType::New(); | 311 arc::mojom::UrlWithMimeType::New(); |
| 307 url_with_type->url = url.spec(); | 312 url_with_type->url = url.spec(); |
| 308 url_with_type->mime_type = entry.mime_type; | 313 url_with_type->mime_type = entry.mime_type; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } else { | 353 } else { |
| 349 arc_intent_helper->HandleUrlListDeprecated( | 354 arc_intent_helper->HandleUrlListDeprecated( |
| 350 std::move(urls), AppIdToActivityName(task.app_id)->package_name, | 355 std::move(urls), AppIdToActivityName(task.app_id)->package_name, |
| 351 StringToArcAction(task.action_id)); | 356 StringToArcAction(task.action_id)); |
| 352 } | 357 } |
| 353 return true; | 358 return true; |
| 354 } | 359 } |
| 355 | 360 |
| 356 } // namespace file_tasks | 361 } // namespace file_tasks |
| 357 } // namespace file_manager | 362 } // namespace file_manager |
| OLD | NEW |