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

Unified Diff: chrome/browser/chromeos/drive/file_system_util.h

Issue 1192493003: Move browser-agnostic code from file_system_util to file_system_core_util. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@drive-prefservice
Patch Set: Rebasing... Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/file_system_util.h
diff --git a/chrome/browser/chromeos/drive/file_system_util.h b/chrome/browser/chromeos/drive/file_system_util.h
index d06b74d8e81e9172b0990cc1324c163d147b7e38..ea9abd57d141f001a0207a3ca50feb7440c0d359 100644
--- a/chrome/browser/chromeos/drive/file_system_util.h
+++ b/chrome/browser/chromeos/drive/file_system_util.h
@@ -24,38 +24,11 @@ class DriveAppRegistry;
class DriveServiceInterface;
class FileSystemInterface;
-
namespace util {
-// "drive" diretory's local ID is fixed to this value.
-const char kDriveGrandRootLocalId[] = "<drive>";
-
-// "drive/other" diretory's local ID is fixed to this value.
-const char kDriveOtherDirLocalId[] = "<other>";
-
-// "drive/trash" diretory's local ID is fixed to this value.
-const char kDriveTrashDirLocalId[] = "<trash>";
-
-// The directory names used for the Google Drive file system tree. These names
-// are used in URLs for the file manager, hence user-visible.
-const char kDriveGrandRootDirName[] = "drive";
-const char kDriveMyDriveRootDirName[] = "root";
-const char kDriveOtherDirName[] = "other";
-const char kDriveTrashDirName[] = "trash";
-
-// Returns the path of the top root of the pseudo tree.
-const base::FilePath& GetDriveGrandRootPath();
-
-// Returns the path of the directory representing "My Drive".
-const base::FilePath& GetDriveMyDriveRootPath();
-
// Returns the Drive mount point path, which looks like "/special/drive-<hash>".
base::FilePath GetDriveMountPointPath(Profile* profile);
-// Returns the Drive mount point path, which looks like
-// "/special/drive-<username_hash>", when provided with the |user_id_hash|.
-base::FilePath GetDriveMountPointPathForUserIdHash(std::string user_id_hash);
-
// Returns the FileSystem for the |profile|. If not available (not mounted
// or disabled), returns NULL.
FileSystemInterface* GetFileSystemByProfile(Profile* profile);
@@ -78,14 +51,6 @@ DriveAppRegistry* GetDriveAppRegistryByProfile(Profile* profile);
// or disabled), returns NULL.
DriveServiceInterface* GetDriveServiceByProfile(Profile* profile);
-// Returns true if the given path is under the Drive mount point.
-bool IsUnderDriveMountPoint(const base::FilePath& path);
-
-// Extracts the Drive path from the given path located under the Drive mount
-// point. Returns an empty path if |path| is not under the Drive mount point.
-// Examples: ExtractDrivePath("/special/drive-xxx/foo.txt") => "drive/foo.txt"
-base::FilePath ExtractDrivePath(const base::FilePath& path);
-
// Extracts |profile| from the given paths located under
// GetDriveMountPointPath(profile). Returns NULL if it does not correspond to
// a valid mount point path. Must be called from UI thread.
@@ -96,27 +61,12 @@ Profile* ExtractProfileFromPath(const base::FilePath& path);
base::FilePath ExtractDrivePathFromFileSystemUrl(
const storage::FileSystemURL& url);
-// Escapes a file name in Drive cache.
-// Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex)
-std::string EscapeCacheFileName(const std::string& filename);
-
-// Unescapes a file path in Drive cache.
-// This is the inverse of EscapeCacheFileName.
-std::string UnescapeCacheFileName(const std::string& filename);
-
-// Converts the given string to a form suitable as a file name. Specifically,
-// - Normalizes in Unicode Normalization Form C.
-// - Replaces slashes '/' with '_'.
-// - Replaces the whole input with "_" if the all input characters are '.'.
-// |input| must be a valid UTF-8 encoded string.
-std::string NormalizeFileName(const std::string& input);
-
// Gets the cache root path (i.e. <user_profile_dir>/GCache/v1) from the
// profile.
base::FilePath GetCacheRootPath(Profile* profile);
// Callback type for PrepareWritableFileAndRun.
-typedef base::Callback<void (FileError, const base::FilePath& path)>
+typedef base::Callback<void(FileError, const base::FilePath& path)>
PrepareWritableFileCallback;
// Invokes |callback| on blocking thread pool, after converting virtual |path|
@@ -142,33 +92,6 @@ void EnsureDirectoryExists(Profile* profile,
const base::FilePath& directory,
const FileOperationCallback& callback);
-// Does nothing with |error|. Used with functions taking FileOperationCallback.
-void EmptyFileOperationCallback(FileError error);
-
-// Helper to destroy objects which needs Destroy() to be called on destruction.
-struct DestroyHelper {
- template<typename T>
- void operator()(T* object) const {
- if (object)
- object->Destroy();
- }
-};
-
-// Creates a GDoc file with given values.
-//
-// GDoc files are used to represent hosted documents on local filesystems.
-// A GDoc file contains a JSON whose content is a URL to view the document and
-// a resource ID of the entry.
-bool CreateGDocFile(const base::FilePath& file_path,
- const GURL& url,
- const std::string& resource_id);
-
-// Reads URL from a GDoc file.
-GURL ReadUrlFromGDocFile(const base::FilePath& file_path);
-
-// Reads resource ID from a GDoc file.
-std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path);
-
// Returns true if Drive is enabled for the given Profile.
bool IsDriveEnabledForProfile(Profile* profile);
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_unittest.cc ('k') | chrome/browser/chromeos/drive/file_system_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698