Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/gdata_util.h |
| diff --git a/chrome/browser/chromeos/gdata/gdata_util.h b/chrome/browser/chromeos/gdata/gdata_util.h |
| index 19674442e58988f2e94a2ceb2ac0438e74a5b2bc..464ae8164adaf7baef43036d5004e8ca6878b61f 100644 |
| --- a/chrome/browser/chromeos/gdata/gdata_util.h |
| +++ b/chrome/browser/chromeos/gdata/gdata_util.h |
| @@ -17,6 +17,23 @@ class Profile; |
| namespace gdata { |
| namespace util { |
| +// Search path is a path used to display gdata content search results. |
| +// All results are displayed under virtual directory "gdata/.search", in which |
| +// each query is given its own directory for displaying results. |
| +enum GDataSearchPathType { |
| + // Not a search path. |
| + GDATA_SEARCH_PATH_INVALID, |
| + // gdata/.search. |
| + GDATA_SEARCH_PATH_ROOT, |
| + // Path that defines search query (gdata/.search/foo). |
| + GDATA_SEARCH_PATH_QUERY, |
| + // Path given to a search result (gdata/.search/foo/foo_found). |
| + // The file name will be formatted: "resource_id.file_name". |
| + GDATA_SEARCH_PATH_RESULT, |
| + // If search result is directory, it may contain some children. |
| + GDATA_SEARCH_PATH_RESULT_CHILD |
| +}; |
| + |
| const char kGDataViewFileHostnameUrl[] = "viewfile"; |
| // Returns the GData mount point path, which looks like "/special/gdata". |
| @@ -41,6 +58,22 @@ void ModifyGDataFileResourceUrl(Profile* profile, |
| // Returns true if the given path is under the GData mount point. |
| bool IsUnderGDataMountPoint(const FilePath& path); |
| +// Checks if the path is under (virtual) gdata search directory, and returns its |
| +// search status. |
| +GDataSearchPathType GetSearchPathStatus(const FilePath& path); |
| + |
| +// Checks if the path is under (virtual) gdata earch directory, and returns its |
| +// search status. |
| +GDataSearchPathType GetSearchPathStatusForPathComponents( |
| + const std::vector<std::string>& path_components); |
| + |
| +// Gets resource id and original file name from the search file name. |
| +// Search file name is formatted as: <resource_id>.<original_file_name>. |
| +// If the path is not search path, the behaviour is not defined. |
| +void ParseSearchFileName(const std::string& search_file_name, |
|
satorux1
2012/05/04 01:48:40
shouldn't this return true/false that indicates su
|
| + std::string* resource_id, |
| + std::string* original_file_name); |
| + |
| // Extracts the GData path from the given path located under the GData mount |
| // point. Returns an empty path if |path| is not under the GData mount point. |
| // Examples: ExtractGDatPath("/special/gdata/foo.txt") => "gdata/foo.txt" |