Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: chrome/browser/chromeos/file_manager/arc_file_tasks.cc

Issue 2141373002: file_manager: Do not return ARC tasks if a directory is selected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698