| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const std::string& GetGDataMountPointPathAsString(); | 50 const std::string& GetGDataMountPointPathAsString(); |
| 51 | 51 |
| 52 // Returns the 'local' root of remote file system as "/special". | 52 // Returns the 'local' root of remote file system as "/special". |
| 53 const FilePath& GetSpecialRemoteRootPath(); | 53 const FilePath& GetSpecialRemoteRootPath(); |
| 54 | 54 |
| 55 // Returns the gdata file resource url formatted as | 55 // Returns the gdata file resource url formatted as |
| 56 // chrome://drive/<resource_id>/<file_name>. | 56 // chrome://drive/<resource_id>/<file_name>. |
| 57 GURL GetFileResourceUrl(const std::string& resource_id, | 57 GURL GetFileResourceUrl(const std::string& resource_id, |
| 58 const std::string& file_name); | 58 const std::string& file_name); |
| 59 | 59 |
| 60 // Given a profile and a gdata_cache_path, return the file resource url. | 60 // Given a profile and a drive_cache_path, return the file resource url. |
| 61 void ModifyGDataFileResourceUrl(Profile* profile, | 61 void ModifyGDataFileResourceUrl(Profile* profile, |
| 62 const FilePath& gdata_cache_path, | 62 const FilePath& drive_cache_path, |
| 63 GURL* url); | 63 GURL* url); |
| 64 | 64 |
| 65 // Returns true if the given path is under the GData mount point. | 65 // Returns true if the given path is under the GData mount point. |
| 66 bool IsUnderGDataMountPoint(const FilePath& path); | 66 bool IsUnderGDataMountPoint(const FilePath& path); |
| 67 | 67 |
| 68 // Extracts the GData path from the given path located under the GData mount | 68 // Extracts the GData path from the given path located under the GData mount |
| 69 // point. Returns an empty path if |path| is not under the GData mount point. | 69 // point. Returns an empty path if |path| is not under the GData mount point. |
| 70 // Examples: ExtractGDatPath("/special/drive/foo.txt") => "drive/foo.txt" | 70 // Examples: ExtractGDatPath("/special/drive/foo.txt") => "drive/foo.txt" |
| 71 FilePath ExtractGDataPath(const FilePath& path); | 71 FilePath ExtractGDataPath(const FilePath& path); |
| 72 | 72 |
| 73 // Inserts all possible cache paths for a given vector of paths on gdata mount | 73 // Inserts all possible cache paths for a given vector of paths on gdata mount |
| 74 // point into the output vector |cache_paths|, and then invokes callback. | 74 // point into the output vector |cache_paths|, and then invokes callback. |
| 75 // Caller must ensure that |cache_paths| lives until the callback is invoked. | 75 // Caller must ensure that |cache_paths| lives until the callback is invoked. |
| 76 void InsertGDataCachePathsPermissions( | 76 void InsertDriveCachePathsPermissions( |
| 77 Profile* profile_, | 77 Profile* profile_, |
| 78 scoped_ptr<std::vector<FilePath> > gdata_paths, | 78 scoped_ptr<std::vector<FilePath> > gdata_paths, |
| 79 std::vector<std::pair<FilePath, int> >* cache_paths, | 79 std::vector<std::pair<FilePath, int> >* cache_paths, |
| 80 const base::Closure& callback); | 80 const base::Closure& callback); |
| 81 | 81 |
| 82 // Returns true if gdata is currently active with the specified profile. | 82 // Returns true if gdata is currently active with the specified profile. |
| 83 bool IsGDataAvailable(Profile* profile); | 83 bool IsGDataAvailable(Profile* profile); |
| 84 | 84 |
| 85 // Escapes a file name in GData cache. | 85 // Escapes a file name in GData cache. |
| 86 // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) | 86 // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void PostBlockingPoolSequencedTaskAndReply( | 152 void PostBlockingPoolSequencedTaskAndReply( |
| 153 const tracked_objects::Location& from_here, | 153 const tracked_objects::Location& from_here, |
| 154 base::SequencedTaskRunner* blocking_task_runner, | 154 base::SequencedTaskRunner* blocking_task_runner, |
| 155 const base::Closure& request_task, | 155 const base::Closure& request_task, |
| 156 const base::Closure& reply_task); | 156 const base::Closure& reply_task); |
| 157 | 157 |
| 158 } // namespace util | 158 } // namespace util |
| 159 } // namespace gdata | 159 } // namespace gdata |
| 160 | 160 |
| 161 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 161 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
| OLD | NEW |