OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | |
13 #include "base/memory/scoped_ptr.h" | |
12 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
13 | 15 |
14 class FilePath; | 16 class FilePath; |
15 class Profile; | 17 class Profile; |
16 | 18 |
17 namespace gdata { | 19 namespace gdata { |
18 namespace util { | 20 namespace util { |
19 | 21 |
20 // Search path is a path used to display gdata content search results. | 22 // Search path is a path used to display gdata content search results. |
21 // All results are displayed under virtual directory "drive/.search", in which | 23 // All results are displayed under virtual directory "drive/.search", in which |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 // If the path is not search path, the behaviour is not defined. | 72 // If the path is not search path, the behaviour is not defined. |
71 bool ParseSearchFileName(const std::string& search_file_name, | 73 bool ParseSearchFileName(const std::string& search_file_name, |
72 std::string* resource_id, | 74 std::string* resource_id, |
73 std::string* original_file_name); | 75 std::string* original_file_name); |
74 | 76 |
75 // Extracts the GData path from the given path located under the GData mount | 77 // Extracts the GData path from the given path located under the GData mount |
76 // point. Returns an empty path if |path| is not under the GData mount point. | 78 // point. Returns an empty path if |path| is not under the GData mount point. |
77 // Examples: ExtractGDatPath("/special/drive/foo.txt") => "drive/foo.txt" | 79 // Examples: ExtractGDatPath("/special/drive/foo.txt") => "drive/foo.txt" |
78 FilePath ExtractGDataPath(const FilePath& path); | 80 FilePath ExtractGDataPath(const FilePath& path); |
79 | 81 |
80 // Returns vector of all possible cache paths for a given path on gdata mount | 82 // Inserts all possible cache paths for a given vector of paths on gdata mount |
81 // point. | 83 // point into the output vector |cache_paths|. |
satorux1
2012/06/08 18:23:52
Please document about |callback|.
hshi1
2012/06/08 18:25:09
Done.
| |
82 void InsertGDataCachePathsPermissions( | 84 void InsertGDataCachePathsPermissions( |
83 Profile* profile_, | 85 Profile* profile_, |
84 const FilePath& gdata_path, | 86 scoped_ptr<std::vector<FilePath> > gdata_paths, |
85 std::vector<std::pair<FilePath, int> >* cache_paths); | 87 std::vector<std::pair<FilePath, int> >* cache_paths, |
88 const base::Closure& callback); | |
86 | 89 |
87 // Returns true if gdata is currently active with the specified profile. | 90 // Returns true if gdata is currently active with the specified profile. |
88 bool IsGDataAvailable(Profile* profile); | 91 bool IsGDataAvailable(Profile* profile); |
89 | 92 |
90 // Escapes a file name in GData cache. | 93 // Escapes a file name in GData cache. |
91 // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) | 94 // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) |
92 std::string EscapeCacheFileName(const std::string& filename); | 95 std::string EscapeCacheFileName(const std::string& filename); |
93 | 96 |
94 // Unescapes a file path in GData cache. | 97 // Unescapes a file path in GData cache. |
95 // This is the inverse of EscapeCacheFileName. | 98 // This is the inverse of EscapeCacheFileName. |
(...skipping 10 matching lines...) Expand all Loading... | |
106 // Example: path="/user/GCache/v1/persistent/pdf:a1b2.01234567.mounted" => | 109 // Example: path="/user/GCache/v1/persistent/pdf:a1b2.01234567.mounted" => |
107 // resource_id="pdf:a1b2", md5="01234567", extra_extension="mounted". | 110 // resource_id="pdf:a1b2", md5="01234567", extra_extension="mounted". |
108 void ParseCacheFilePath(const FilePath& path, | 111 void ParseCacheFilePath(const FilePath& path, |
109 std::string* resource_id, | 112 std::string* resource_id, |
110 std::string* md5, | 113 std::string* md5, |
111 std::string* extra_extension); | 114 std::string* extra_extension); |
112 } // namespace util | 115 } // namespace util |
113 } // namespace gdata | 116 } // namespace gdata |
114 | 117 |
115 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 118 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
OLD | NEW |