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_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 }; | 587 }; |
588 | 588 |
589 // Defines set of parameters sent to callback OnGetDocuments(). | 589 // Defines set of parameters sent to callback OnGetDocuments(). |
590 struct GetDocumentsParams { | 590 struct GetDocumentsParams { |
591 GetDocumentsParams(int start_changestamp, | 591 GetDocumentsParams(int start_changestamp, |
592 int root_feed_changestamp, | 592 int root_feed_changestamp, |
593 std::vector<DocumentFeed*>* feed_list, | 593 std::vector<DocumentFeed*>* feed_list, |
594 bool should_fetch_multiple_feeds, | 594 bool should_fetch_multiple_feeds, |
595 const FilePath& search_file_path, | 595 const FilePath& search_file_path, |
596 const std::string& search_query, | 596 const std::string& search_query, |
| 597 const std::string& directory_resource_id, |
597 const FindEntryCallback& callback); | 598 const FindEntryCallback& callback); |
598 ~GetDocumentsParams(); | 599 ~GetDocumentsParams(); |
599 | 600 |
600 // Changestamps are positive numbers in increasing order. The difference | 601 // Changestamps are positive numbers in increasing order. The difference |
601 // between two changestamps is proportional equal to number of items in | 602 // between two changestamps is proportional equal to number of items in |
602 // delta feed between them - bigger the difference, more likely bigger | 603 // delta feed between them - bigger the difference, more likely bigger |
603 // number of items in delta feeds. | 604 // number of items in delta feeds. |
604 int start_changestamp; | 605 int start_changestamp; |
605 int root_feed_changestamp; | 606 int root_feed_changestamp; |
606 scoped_ptr<std::vector<DocumentFeed*> > feed_list; | 607 scoped_ptr<std::vector<DocumentFeed*> > feed_list; |
607 // Should we stop after getting first feed chunk, even if there is more | 608 // Should we stop after getting first feed chunk, even if there is more |
608 // data. | 609 // data. |
609 bool should_fetch_multiple_feeds; | 610 bool should_fetch_multiple_feeds; |
610 FilePath search_file_path; | 611 FilePath search_file_path; |
611 std::string search_query; | 612 std::string search_query; |
| 613 std::string directory_resource_id; |
612 FindEntryCallback callback; | 614 FindEntryCallback callback; |
613 }; | 615 }; |
614 | 616 |
615 typedef std::map<std::string /* resource_id */, GDataEntry*> | 617 typedef std::map<std::string /* resource_id */, GDataEntry*> |
616 FileResourceIdMap; | 618 FileResourceIdMap; |
617 | 619 |
618 // Callback similar to FileOperationCallback but with a given |file_path|. | 620 // Callback similar to FileOperationCallback but with a given |file_path|. |
619 typedef base::Callback<void(base::PlatformFileError error, | 621 typedef base::Callback<void(base::PlatformFileError error, |
620 const FilePath& file_path)> | 622 const FilePath& file_path)> |
621 FilePathUpdateCallback; | 623 FilePathUpdateCallback; |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 // |should_fetch_multiple_feeds| is true iff don't want to stop feed loading | 938 // |should_fetch_multiple_feeds| is true iff don't want to stop feed loading |
937 // after we retrieve first feed chunk. | 939 // after we retrieve first feed chunk. |
938 // If invoked as a part of content search, query will be set in | 940 // If invoked as a part of content search, query will be set in |
939 // |search_query|. | 941 // |search_query|. |
940 void LoadFeedFromServer(ContentOrigin initial_origin, | 942 void LoadFeedFromServer(ContentOrigin initial_origin, |
941 int start_changestamp, | 943 int start_changestamp, |
942 int root_feed_changestamp, | 944 int root_feed_changestamp, |
943 bool should_fetch_multiple_feeds, | 945 bool should_fetch_multiple_feeds, |
944 const FilePath& search_file_path, | 946 const FilePath& search_file_path, |
945 const std::string& search_query, | 947 const std::string& search_query, |
| 948 const std::string& directory_resource_id, |
946 const FindEntryCallback& entry_found_callback, | 949 const FindEntryCallback& entry_found_callback, |
947 const LoadDocumentFeedCallback& load_feed_callback); | 950 const LoadDocumentFeedCallback& load_feed_callback); |
948 | 951 |
949 // Callback for handling feed content fetching while searching for file info. | 952 // Callback for handling feed content fetching while searching for file info. |
950 // This callback is invoked after async feed fetch operation that was | 953 // This callback is invoked after async feed fetch operation that was |
951 // invoked by StartDirectoryRefresh() completes. This callback will update | 954 // invoked by StartDirectoryRefresh() completes. This callback will update |
952 // the content of the refreshed directory object and continue initially | 955 // the content of the refreshed directory object and continue initially |
953 // started FindEntryByPath() request. | 956 // started FindEntryByPath() request. |
954 void OnFeedFromServerLoaded(GetDocumentsParams* params, | 957 void OnFeedFromServerLoaded(GetDocumentsParams* params, |
955 base::PlatformFileError status); | 958 base::PlatformFileError status); |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1474 }; | 1477 }; |
1475 | 1478 |
1476 // Sets the free disk space getter for testing. | 1479 // Sets the free disk space getter for testing. |
1477 // The existing getter is deleted. | 1480 // The existing getter is deleted. |
1478 void SetFreeDiskSpaceGetterForTesting( | 1481 void SetFreeDiskSpaceGetterForTesting( |
1479 FreeDiskSpaceGetterInterface* getter); | 1482 FreeDiskSpaceGetterInterface* getter); |
1480 | 1483 |
1481 } // namespace gdata | 1484 } // namespace gdata |
1482 | 1485 |
1483 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1486 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |