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

Side by Side Diff: chrome/browser/chromeos/fileapi/external_file_url_util.cc

Issue 2450713002: arc: Register ARC content file system (Closed)
Patch Set: Address comments Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/fileapi/external_file_url_util.h" 5 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "chrome/browser/chromeos/file_manager/app_id.h" 12 #include "chrome/browser/chromeos/file_manager/app_id.h"
13 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" 13 #include "chrome/browser/chromeos/file_manager/fileapi_util.h"
14 #include "chrome/browser/extensions/extension_util.h" 14 #include "chrome/browser/extensions/extension_util.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "content/public/browser/browser_context.h" 16 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/storage_partition.h" 18 #include "content/public/browser/storage_partition.h"
19 #include "content/public/common/url_constants.h" 19 #include "content/public/common/url_constants.h"
20 #include "net/base/escape.h" 20 #include "net/base/escape.h"
21 #include "storage/browser/fileapi/file_system_url.h" 21 #include "storage/browser/fileapi/file_system_url.h"
22 22
23 using content::BrowserThread; 23 using content::BrowserThread;
24 24
25 namespace chromeos { 25 namespace chromeos {
26 26
27 bool IsExternalFileURLType(storage::FileSystemType type) { 27 bool IsExternalFileURLType(storage::FileSystemType type) {
28 return type == storage::kFileSystemTypeDrive || 28 return type == storage::kFileSystemTypeDrive ||
29 type == storage::kFileSystemTypeDeviceMediaAsFileStorage || 29 type == storage::kFileSystemTypeDeviceMediaAsFileStorage ||
30 type == storage::kFileSystemTypeProvided; 30 type == storage::kFileSystemTypeProvided ||
31 type == storage::kFileSystemTypeArcContent;
31 } 32 }
32 33
33 GURL FileSystemURLToExternalFileURL( 34 GURL FileSystemURLToExternalFileURL(
34 const storage::FileSystemURL& file_system_url) { 35 const storage::FileSystemURL& file_system_url) {
35 if (file_system_url.mount_type() != storage::kFileSystemTypeExternal || 36 if (file_system_url.mount_type() != storage::kFileSystemTypeExternal ||
36 !IsExternalFileURLType(file_system_url.type())) { 37 !IsExternalFileURLType(file_system_url.type())) {
37 return GURL(); 38 return GURL();
38 } 39 }
39 40
40 return VirtualPathToExternalFileURL(file_system_url.virtual_path()); 41 return VirtualPathToExternalFileURL(file_system_url.virtual_path());
(...skipping 29 matching lines...) Expand all
70 file_manager::util::GetFileSystemContextForExtensionId( 71 file_manager::util::GetFileSystemContextForExtensionId(
71 profile, file_manager::kFileManagerAppId) 72 profile, file_manager::kFileManagerAppId)
72 ->CrackURL(raw_file_system_url); 73 ->CrackURL(raw_file_system_url);
73 if (!file_system_url.is_valid()) 74 if (!file_system_url.is_valid())
74 return GURL(); 75 return GURL();
75 76
76 return FileSystemURLToExternalFileURL(file_system_url); 77 return FileSystemURLToExternalFileURL(file_system_url);
77 } 78 }
78 79
79 } // namespace chromeos 80 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698