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

Side by Side Diff: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.cc

Issue 2580713004: mediaview: Implement ArcDocumentsProviderBackendDelegate. (Closed)
Patch Set: Removed unused #include. Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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/arc/fileapi/arc_documents_provider_util.h" 5 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h"
11 #include "net/base/escape.h"
10 #include "storage/browser/fileapi/file_system_url.h" 12 #include "storage/browser/fileapi/file_system_url.h"
13 #include "url/gurl.h"
11 14
12 namespace arc { 15 namespace arc {
13 16
14 const char kDocumentsProviderMountPointName[] = "arc-documents-provider"; 17 const char kDocumentsProviderMountPointName[] = "arc-documents-provider";
15 const base::FilePath::CharType kDocumentsProviderMountPointPath[] = 18 const base::FilePath::CharType kDocumentsProviderMountPointPath[] =
16 "/special/arc-documents-provider"; 19 "/special/arc-documents-provider";
17 const char kAndroidDirectoryMimeType[] = "vnd.android.document/directory"; 20 const char kAndroidDirectoryMimeType[] = "vnd.android.document/directory";
18 21
19 bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url, 22 bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url,
20 std::string* authority, 23 std::string* authority,
(...skipping 24 matching lines...) Expand all
45 // Special case: AppendRelativePath() fails for identical paths. 48 // Special case: AppendRelativePath() fails for identical paths.
46 if (url_path_stripped == root_path) { 49 if (url_path_stripped == root_path) {
47 path->clear(); 50 path->clear();
48 } else { 51 } else {
49 bool success = root_path.AppendRelativePath(url_path_stripped, path); 52 bool success = root_path.AppendRelativePath(url_path_stripped, path);
50 DCHECK(success); 53 DCHECK(success);
51 } 54 }
52 return true; 55 return true;
53 } 56 }
54 57
58 GURL BuildDocumentUrl(const std::string& authority,
59 const std::string& document_id) {
60 return GURL(base::StringPrintf(
61 "content://%s/document/%s",
62 net::EscapeQueryParamValue(authority, false /* use_plus */).c_str(),
63 net::EscapeQueryParamValue(document_id, false /* use_plus */).c_str()));
64 }
65
55 } // namespace arc 66 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698