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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h

Issue 15814002: drive: Stop calling OpenFileSystem from SearchDriveFunction/SearchDriveMetadataFunction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MANAGER_FILE_BROWSER_PRIVATE_API _H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API _H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API _H_ 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 FILEBROWSERPRIVATE_SEARCHDRIVE) 649 FILEBROWSERPRIVATE_SEARCHDRIVE)
650 650
651 SearchDriveFunction(); 651 SearchDriveFunction();
652 652
653 protected: 653 protected:
654 virtual ~SearchDriveFunction(); 654 virtual ~SearchDriveFunction();
655 655
656 virtual bool RunImpl() OVERRIDE; 656 virtual bool RunImpl() OVERRIDE;
657 657
658 private: 658 private:
659 // Callback fo OpenFileSystem called from RunImpl. 659 // Callback for Search().
660 void OnFileSystemOpened(base::PlatformFileError result,
661 const std::string& file_system_name,
662 const GURL& file_system_url);
663 // Callback for google_apis::SearchAsync called after file system is opened.
664 void OnSearch(drive::FileError error, 660 void OnSearch(drive::FileError error,
665 const GURL& next_feed, 661 const GURL& next_feed,
666 scoped_ptr<std::vector<drive::SearchResultInfo> > result_paths); 662 scoped_ptr<std::vector<drive::SearchResultInfo> > result_paths);
667
668 // Query for which the search is being performed.
669 std::string query_;
670 std::string next_feed_;
671 // Information about remote file system we will need to create file entries
672 // to represent search results.
673 std::string file_system_name_;
674 GURL file_system_url_;
675 }; 663 };
676 664
677 // Similar to SearchDriveFunction but this one is used for searching drive 665 // Similar to SearchDriveFunction but this one is used for searching drive
678 // metadata which is stored locally. 666 // metadata which is stored locally.
679 class SearchDriveMetadataFunction : public FileBrowserFunction { 667 class SearchDriveMetadataFunction : public FileBrowserFunction {
680 public: 668 public:
681 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.searchDriveMetadata", 669 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.searchDriveMetadata",
682 FILEBROWSERPRIVATE_SEARCHDRIVEMETADATA) 670 FILEBROWSERPRIVATE_SEARCHDRIVEMETADATA)
683 671
684 SearchDriveMetadataFunction(); 672 SearchDriveMetadataFunction();
685 673
686 protected: 674 protected:
687 virtual ~SearchDriveMetadataFunction(); 675 virtual ~SearchDriveMetadataFunction();
688 676
689 virtual bool RunImpl() OVERRIDE; 677 virtual bool RunImpl() OVERRIDE;
690 678
691 private: 679 private:
692 // Callback fo OpenFileSystem called from RunImpl. 680 // Callback for SearchMetadata();
693 void OnFileSystemOpened(base::PlatformFileError result, 681 void OnSearchMetadata(drive::FileError error,
694 const std::string& file_system_name, 682 scoped_ptr<drive::MetadataSearchResultVector> results);
695 const GURL& file_system_url);
696 // Callback for LocalSearch().
697 void OnSearchMetadata(
698 drive::FileError error,
699 scoped_ptr<drive::MetadataSearchResultVector> results);
700
701 // Query for which the search is being performed.
702 std::string query_;
703 // String representing what type of entries are needed. It corresponds to
704 // SearchMetadataOptions:
705 // SEARCH_METADATA_OPTION_EXCLUDE_DIRECTORIES => "EXCLUDE_DIRECTORIES"
706 // SEARCH_METADATA_OPTION_ALL => "ALL"
707 std::string types_;
708 // Maximum number of results. The results contains |max_num_results_| entries
709 // at most.
710 int max_results_;
711
712 // Information about remote file system we will need to create file entries
713 // to represent search results.
714 std::string file_system_name_;
715 GURL file_system_url_;
716 }; 683 };
717 684
718 class ClearDriveCacheFunction : public AsyncExtensionFunction { 685 class ClearDriveCacheFunction : public AsyncExtensionFunction {
719 public: 686 public:
720 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.clearDriveCache", 687 DECLARE_EXTENSION_FUNCTION("fileBrowserPrivate.clearDriveCache",
721 FILEBROWSERPRIVATE_CLEARDRIVECACHE) 688 FILEBROWSERPRIVATE_CLEARDRIVECACHE)
722 689
723 protected: 690 protected:
724 virtual ~ClearDriveCacheFunction() {} 691 virtual ~ClearDriveCacheFunction() {}
725 692
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 OpenNewWindowFunction(); 780 OpenNewWindowFunction();
814 781
815 protected: 782 protected:
816 virtual ~OpenNewWindowFunction(); 783 virtual ~OpenNewWindowFunction();
817 784
818 // AsyncExtensionFunction overrides. 785 // AsyncExtensionFunction overrides.
819 virtual bool RunImpl() OVERRIDE; 786 virtual bool RunImpl() OVERRIDE;
820 }; 787 };
821 788
822 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_ API_H_ 789 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_ API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698