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_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" | 14 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" |
15 #include "chrome/browser/google_apis/gdata_errorcode.h" | 15 #include "chrome/browser/google_apis/gdata_errorcode.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 | 17 |
18 class FilePath; | 18 class FilePath; |
19 class Profile; | 19 class Profile; |
20 | 20 |
21 namespace gdata { | 21 namespace drive { |
22 namespace util { | 22 namespace util { |
23 | 23 |
24 // Path constants. | 24 // Path constants. |
25 | 25 |
26 // The extension for dirty files. The file names look like | 26 // The extension for dirty files. The file names look like |
27 // "<resource-id>.local". | 27 // "<resource-id>.local". |
28 const char kLocallyModifiedFileExtension[] = "local"; | 28 const char kLocallyModifiedFileExtension[] = "local"; |
29 // The extension for mounted files. The file names look like | 29 // The extension for mounted files. The file names look like |
30 // "<resource-id>.<md5>.mounted". | 30 // "<resource-id>.<md5>.mounted". |
31 const char kMountedArchiveFileExtension[] = "mounted"; | 31 const char kMountedArchiveFileExtension[] = "mounted"; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // | 124 // |
125 // If |directory| is not a Drive path, it won't check the existence and just | 125 // If |directory| is not a Drive path, it won't check the existence and just |
126 // runs |callback|. | 126 // runs |callback|. |
127 // | 127 // |
128 // Must be called from UI/IO thread. | 128 // Must be called from UI/IO thread. |
129 void EnsureDirectoryExists(Profile* profile, | 129 void EnsureDirectoryExists(Profile* profile, |
130 const FilePath& directory, | 130 const FilePath& directory, |
131 const FileOperationCallback& callback); | 131 const FileOperationCallback& callback); |
132 | 132 |
133 // Converts GData error code into file platform error code. | 133 // Converts GData error code into file platform error code. |
134 DriveFileError GDataToDriveFileError(GDataErrorCode status); | 134 DriveFileError GDataToDriveFileError(gdata::GDataErrorCode status); |
135 | 135 |
136 // Returns true if the curernt network connection is over cellular. | 136 // Returns true if the curernt network connection is over cellular. |
137 bool IsConnectionTypeCellular(); | 137 bool IsConnectionTypeCellular(); |
138 | 138 |
139 } // namespace util | 139 } // namespace util |
140 } // namespace gdata | 140 } // namespace drive |
141 | 141 |
142 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ | 142 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |