Chromium Code Reviews| 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_RESOURCE_METADATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 FROM_SERVER, | 57 FROM_SERVER, |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Converts a ContentOrigin constant to a string of its name. | 60 // Converts a ContentOrigin constant to a string of its name. |
| 61 std::string ContentOriginToString(ContentOrigin origin); | 61 std::string ContentOriginToString(ContentOrigin origin); |
| 62 | 62 |
| 63 // The root directory name used for the Google Drive file system tree. The | 63 // The root directory name used for the Google Drive file system tree. The |
| 64 // name is used in URLs for the file manager, hence user-visible. | 64 // name is used in URLs for the file manager, hence user-visible. |
| 65 const FilePath::CharType kDriveRootDirectory[] = FILE_PATH_LITERAL("drive"); | 65 const FilePath::CharType kDriveRootDirectory[] = FILE_PATH_LITERAL("drive"); |
| 66 | 66 |
| 67 // The resource ID for the root directory is defined in the spec: | 67 // The resource ID for the root directory for WAPI is defined in the spec: |
| 68 // https://developers.google.com/google-apps/documents-list/ | 68 // https://developers.google.com/google-apps/documents-list/ |
| 69 const char kDriveRootDirectoryResourceId[] = "folder:root"; | 69 // Note that this special ID only applies to WAPI. Drive uses a non-constant |
| 70 // unique ID given in About resource. | |
| 71 const char kWAPIRootDirectoryResourceId[] = "folder:root"; | |
| 70 | 72 |
| 71 // This should be incremented when incompatibility change is made in | 73 // This should be incremented when incompatibility change is made in |
| 72 // drive.proto. | 74 // drive.proto. |
| 73 const int32 kProtoVersion = 2; | 75 const int32 kProtoVersion = 2; |
| 74 | 76 |
| 75 // Used for file operations like removing files. | 77 // Used for file operations like removing files. |
| 76 typedef base::Callback<void(DriveFileError error)> | 78 typedef base::Callback<void(DriveFileError error)> |
| 77 FileOperationCallback; | 79 FileOperationCallback; |
| 78 | 80 |
| 79 // Callback similar to FileOperationCallback but with a given |file_path|. | 81 // Callback similar to FileOperationCallback but with a given |file_path|. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 // Creates a DriveEntry from a google_apis::DocumentEntry. | 161 // Creates a DriveEntry from a google_apis::DocumentEntry. |
| 160 scoped_ptr<DriveEntry> FromDocumentEntry( | 162 scoped_ptr<DriveEntry> FromDocumentEntry( |
| 161 const google_apis::DocumentEntry& doc); | 163 const google_apis::DocumentEntry& doc); |
| 162 | 164 |
| 163 // Creates a DriveFile instance. | 165 // Creates a DriveFile instance. |
| 164 scoped_ptr<DriveFile> CreateDriveFile(); | 166 scoped_ptr<DriveFile> CreateDriveFile(); |
| 165 | 167 |
| 166 // Creates a DriveDirectory instance. | 168 // Creates a DriveDirectory instance. |
| 167 scoped_ptr<DriveDirectory> CreateDriveDirectory(); | 169 scoped_ptr<DriveDirectory> CreateDriveDirectory(); |
| 168 | 170 |
| 169 // Sets root directory resource id and initialize the root entry. | 171 // Sets root directory resource ID and put root to ResourceMap. |
| 170 void InitializeRootEntry(const std::string& root_id); | 172 void SetRootResourceId(const std::string& id); |
|
satorux1
2012/10/26 07:52:44
Let's rename this back to InitializeRootEntry()
I
kochi
2012/10/26 09:01:23
Done.
| |
| 171 | 173 |
| 172 // Add |doc entry| to directory with path |directory_path| and invoke the | 174 // Add |doc entry| to directory with path |directory_path| and invoke the |
| 173 // callback asynchronously. | 175 // callback asynchronously. |
| 174 // |callback| must not be null. | 176 // |callback| must not be null. |
| 175 void AddEntryToDirectory(const FilePath& directory_path, | 177 void AddEntryToDirectory(const FilePath& directory_path, |
| 176 scoped_ptr<google_apis::DocumentEntry> doc_entry, | 178 scoped_ptr<google_apis::DocumentEntry> doc_entry, |
| 177 const FileMoveCallback& callback); | 179 const FileMoveCallback& callback); |
| 178 | 180 |
| 179 // Moves entry specified by |file_path| to the directory specified by | 181 // Moves entry specified by |file_path| to the directory specified by |
| 180 // |directory_path| and calls the callback asynchronously. Removes the entry | 182 // |directory_path| and calls the callback asynchronously. Removes the entry |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 // This should remain the last member so it'll be destroyed first and | 327 // This should remain the last member so it'll be destroyed first and |
| 326 // invalidate its weak pointers before other members are destroyed. | 328 // invalidate its weak pointers before other members are destroyed. |
| 327 base::WeakPtrFactory<DriveResourceMetadata> weak_ptr_factory_; | 329 base::WeakPtrFactory<DriveResourceMetadata> weak_ptr_factory_; |
| 328 | 330 |
| 329 DISALLOW_COPY_AND_ASSIGN(DriveResourceMetadata); | 331 DISALLOW_COPY_AND_ASSIGN(DriveResourceMetadata); |
| 330 }; | 332 }; |
| 331 | 333 |
| 332 } // namespace drive | 334 } // namespace drive |
| 333 | 335 |
| 334 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ | 336 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_RESOURCE_METADATA_H_ |
| OLD | NEW |