| 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_FILE_SYSTEM_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/chromeos/drive/drive.pb.h" | 12 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 13 #include "chrome/browser/chromeos/drive/file_system_metadata.h" | 13 #include "chrome/browser/chromeos/drive/file_system_metadata.h" |
| 14 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 14 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
| 15 #include "google_apis/drive/base_requests.h" | 15 #include "google_apis/drive/base_requests.h" |
| 16 #include "google_apis/drive/drive_api_requests.h" | 16 #include "google_apis/drive/drive_api_requests.h" |
| 17 | 17 |
| 18 namespace user_manager { |
| 19 class UserID; |
| 20 } |
| 21 |
| 18 namespace drive { | 22 namespace drive { |
| 19 | 23 |
| 20 class FileSystemObserver; | 24 class FileSystemObserver; |
| 21 | 25 |
| 22 // Information about search result returned by Search Async callback. | 26 // Information about search result returned by Search Async callback. |
| 23 // This is data needed to create a file system entry that will be used by file | 27 // This is data needed to create a file system entry that will be used by file |
| 24 // browser. | 28 // browser. |
| 25 struct SearchResultInfo { | 29 struct SearchResultInfo { |
| 26 SearchResultInfo(const base::FilePath& path, bool is_directory) | 30 SearchResultInfo(const base::FilePath& path, bool is_directory) |
| 27 : path(path), is_directory(is_directory) {} | 31 : path(path), is_directory(is_directory) {} |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 const MarkMountedCallback& callback) = 0; | 429 const MarkMountedCallback& callback) = 0; |
| 426 | 430 |
| 427 // Marks the cached file as unmounted, and runs |callback| upon completion. | 431 // Marks the cached file as unmounted, and runs |callback| upon completion. |
| 428 // Note that this method expects that the |cached_file_path| is the path | 432 // Note that this method expects that the |cached_file_path| is the path |
| 429 // returned by MarkCacheFileAsMounted(). | 433 // returned by MarkCacheFileAsMounted(). |
| 430 // |callback| must not be null. | 434 // |callback| must not be null. |
| 431 virtual void MarkCacheFileAsUnmounted( | 435 virtual void MarkCacheFileAsUnmounted( |
| 432 const base::FilePath& cache_file_path, | 436 const base::FilePath& cache_file_path, |
| 433 const FileOperationCallback& callback) = 0; | 437 const FileOperationCallback& callback) = 0; |
| 434 | 438 |
| 435 // Adds permission as |role| to |email| for the entry at |drive_file_path|. | 439 // Adds permission as |role| to |user_id| for the entry at |drive_file_path|. |
| 436 // |callback| must not be null. | 440 // |callback| must not be null. |
| 437 virtual void AddPermission(const base::FilePath& drive_file_path, | 441 virtual void AddPermission(const base::FilePath& drive_file_path, |
| 438 const std::string& email, | 442 const user_manager::UserID& email, |
| 439 google_apis::drive::PermissionRole role, | 443 google_apis::drive::PermissionRole role, |
| 440 const FileOperationCallback& callback) = 0; | 444 const FileOperationCallback& callback) = 0; |
| 441 | 445 |
| 442 // Sets the |key| property on the file or directory at |drive_file_path| with | 446 // Sets the |key| property on the file or directory at |drive_file_path| with |
| 443 // the specified |visibility|. If already exists, then it will be overwritten. | 447 // the specified |visibility|. If already exists, then it will be overwritten. |
| 444 virtual void SetProperty(const base::FilePath& drive_file_path, | 448 virtual void SetProperty(const base::FilePath& drive_file_path, |
| 445 google_apis::drive::Property::Visibility visibility, | 449 google_apis::drive::Property::Visibility visibility, |
| 446 const std::string& key, | 450 const std::string& key, |
| 447 const std::string& value, | 451 const std::string& value, |
| 448 const FileOperationCallback& callback) = 0; | 452 const FileOperationCallback& callback) = 0; |
| 449 | 453 |
| 450 // Resets local data. | 454 // Resets local data. |
| 451 virtual void Reset(const FileOperationCallback& callback) = 0; | 455 virtual void Reset(const FileOperationCallback& callback) = 0; |
| 452 | 456 |
| 453 // Finds a path of an entry (a file or a directory) by |resource_id|. | 457 // Finds a path of an entry (a file or a directory) by |resource_id|. |
| 454 virtual void GetPathFromResourceId(const std::string& resource_id, | 458 virtual void GetPathFromResourceId(const std::string& resource_id, |
| 455 const GetFilePathCallback& callback) = 0; | 459 const GetFilePathCallback& callback) = 0; |
| 456 | 460 |
| 457 // Free drive caches if needed to secure given available spaces. |callback| | 461 // Free drive caches if needed to secure given available spaces. |callback| |
| 458 // takes whether given bytes are available or not. | 462 // takes whether given bytes are available or not. |
| 459 virtual void FreeDiskSpaceIfNeededFor( | 463 virtual void FreeDiskSpaceIfNeededFor( |
| 460 int64 num_bytes, | 464 int64 num_bytes, |
| 461 const FreeDiskSpaceCallback& callback) = 0; | 465 const FreeDiskSpaceCallback& callback) = 0; |
| 462 }; | 466 }; |
| 463 | 467 |
| 464 } // namespace drive | 468 } // namespace drive |
| 465 | 469 |
| 466 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 470 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
| OLD | NEW |