| 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_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 // SyncExtensionFunction overrides. | 489 // SyncExtensionFunction overrides. |
| 490 virtual bool RunImpl() OVERRIDE; | 490 virtual bool RunImpl() OVERRIDE; |
| 491 }; | 491 }; |
| 492 | 492 |
| 493 // Retrieve property information for multiple files, returning a list of the | 493 // Retrieve property information for multiple files, returning a list of the |
| 494 // same length as the input list of file URLs. If a particular file has an | 494 // same length as the input list of file URLs. If a particular file has an |
| 495 // error, then return a dictionary with the key "error" set to the error number | 495 // error, then return a dictionary with the key "error" set to the error number |
| 496 // (drive::DriveFileError) for that entry in the returned list. | 496 // (drive::DriveFileError) for that entry in the returned list. |
| 497 class GetDriveFilePropertiesFunction : public FileBrowserFunction { | 497 class GetDriveFilePropertiesFunction : public FileBrowserFunction { |
| 498 public: | 498 public: |
| 499 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFileProperties"); | 499 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getDriveFileProperties"); |
| 500 | 500 |
| 501 GetDriveFilePropertiesFunction(); | 501 GetDriveFilePropertiesFunction(); |
| 502 | 502 |
| 503 protected: | 503 protected: |
| 504 virtual ~GetDriveFilePropertiesFunction(); | 504 virtual ~GetDriveFilePropertiesFunction(); |
| 505 | 505 |
| 506 void GetNextFileProperties(); | 506 void GetNextFileProperties(); |
| 507 void CompleteGetFileProperties(); | 507 void CompleteGetFileProperties(); |
| 508 | 508 |
| 509 // Virtual function that can be overridden to do operations on each virtual | 509 // Virtual function that can be overridden to do operations on each virtual |
| (...skipping 29 matching lines...) Expand all Loading... |
| 539 }; | 539 }; |
| 540 | 540 |
| 541 // Pin/unpin multiple files in the cache, returning a list of file | 541 // Pin/unpin multiple files in the cache, returning a list of file |
| 542 // properties with the updated cache state. The returned array is the | 542 // properties with the updated cache state. The returned array is the |
| 543 // same length as the input list of file URLs. If a particular file | 543 // same length as the input list of file URLs. If a particular file |
| 544 // has an error, then return a dictionary with the key "error" set to | 544 // has an error, then return a dictionary with the key "error" set to |
| 545 // the error number (drive::DriveFileError) for that entry in the | 545 // the error number (drive::DriveFileError) for that entry in the |
| 546 // returned list. | 546 // returned list. |
| 547 class PinDriveFileFunction : public GetDriveFilePropertiesFunction { | 547 class PinDriveFileFunction : public GetDriveFilePropertiesFunction { |
| 548 public: | 548 public: |
| 549 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.pinGDataFile"); | 549 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.pinDriveFile"); |
| 550 | 550 |
| 551 PinDriveFileFunction(); | 551 PinDriveFileFunction(); |
| 552 | 552 |
| 553 protected: | 553 protected: |
| 554 virtual ~PinDriveFileFunction(); | 554 virtual ~PinDriveFileFunction(); |
| 555 | 555 |
| 556 // AsyncExtensionFunction overrides. | 556 // AsyncExtensionFunction overrides. |
| 557 virtual bool RunImpl() OVERRIDE; | 557 virtual bool RunImpl() OVERRIDE; |
| 558 | 558 |
| 559 private: | 559 private: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 // Get gdata files for the given list of file URLs. Initiate downloading of | 599 // Get gdata files for the given list of file URLs. Initiate downloading of |
| 600 // gdata files if these are not cached. Return a list of local file names. | 600 // gdata files if these are not cached. Return a list of local file names. |
| 601 // This function puts empty strings instead of local paths for files could | 601 // This function puts empty strings instead of local paths for files could |
| 602 // not be obtained. For instance, this can happen if the user specifies a new | 602 // not be obtained. For instance, this can happen if the user specifies a new |
| 603 // file name to save a file on gdata. There may be other reasons to fail. The | 603 // file name to save a file on gdata. There may be other reasons to fail. The |
| 604 // file manager should check if the local paths returned from getDriveFiles() | 604 // file manager should check if the local paths returned from getDriveFiles() |
| 605 // contain empty paths. | 605 // contain empty paths. |
| 606 // TODO(satorux): Should we propagate error types to the JavasScript layer? | 606 // TODO(satorux): Should we propagate error types to the JavasScript layer? |
| 607 class GetDriveFilesFunction : public FileBrowserFunction { | 607 class GetDriveFilesFunction : public FileBrowserFunction { |
| 608 public: | 608 public: |
| 609 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFiles"); | 609 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getDriveFiles"); |
| 610 | 610 |
| 611 GetDriveFilesFunction(); | 611 GetDriveFilesFunction(); |
| 612 | 612 |
| 613 protected: | 613 protected: |
| 614 virtual ~GetDriveFilesFunction(); | 614 virtual ~GetDriveFilesFunction(); |
| 615 | 615 |
| 616 // AsyncExtensionFunction overrides. | 616 // AsyncExtensionFunction overrides. |
| 617 virtual bool RunImpl() OVERRIDE; | 617 virtual bool RunImpl() OVERRIDE; |
| 618 | 618 |
| 619 private: | 619 private: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.setPreferences"); | 708 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.setPreferences"); |
| 709 | 709 |
| 710 protected: | 710 protected: |
| 711 virtual ~SetPreferencesFunction() {} | 711 virtual ~SetPreferencesFunction() {} |
| 712 | 712 |
| 713 virtual bool RunImpl() OVERRIDE; | 713 virtual bool RunImpl() OVERRIDE; |
| 714 }; | 714 }; |
| 715 | 715 |
| 716 class SearchDriveFunction : public AsyncExtensionFunction { | 716 class SearchDriveFunction : public AsyncExtensionFunction { |
| 717 public: | 717 public: |
| 718 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.searchGData"); | 718 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.searchDrive"); |
| 719 | 719 |
| 720 SearchDriveFunction(); | 720 SearchDriveFunction(); |
| 721 | 721 |
| 722 protected: | 722 protected: |
| 723 virtual ~SearchDriveFunction(); | 723 virtual ~SearchDriveFunction(); |
| 724 | 724 |
| 725 virtual bool RunImpl() OVERRIDE; | 725 virtual bool RunImpl() OVERRIDE; |
| 726 | 726 |
| 727 private: | 727 private: |
| 728 // Callback fo OpenFileSystem called from RunImpl. | 728 // Callback fo OpenFileSystem called from RunImpl. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 private: | 809 private: |
| 810 // A callback method to handle the result of | 810 // A callback method to handle the result of |
| 811 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread. | 811 // GetLocalPathsOnFileThreadAndRunCallbackOnUIThread. |
| 812 void GetLocalPathsResponseOnUIThread(const std::string dest_name, | 812 void GetLocalPathsResponseOnUIThread(const std::string dest_name, |
| 813 const SelectedFileInfoList& files); | 813 const SelectedFileInfoList& files); |
| 814 | 814 |
| 815 scoped_refptr<extensions::ZipFileCreator> zip_file_creator_; | 815 scoped_refptr<extensions::ZipFileCreator> zip_file_creator_; |
| 816 }; | 816 }; |
| 817 | 817 |
| 818 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 818 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
| OLD | NEW |