OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SEARCH_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
13 #include "chrome/browser/chromeos/drive/file_errors.h" | 13 #include "chrome/browser/chromeos/drive/file_errors.h" |
14 #include "chrome/browser/chromeos/drive/file_system/operations.h" | 14 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
15 #include "chrome/browser/google_apis/gdata_errorcode.h" | 15 #include "chrome/browser/google_apis/gdata_errorcode.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace google_apis { | 19 namespace google_apis { |
20 class ResourceEntry; | 20 class ResourceEntry; |
21 } // namespace google_apis | 21 } // namespace google_apis |
22 | 22 |
23 namespace drive { | 23 namespace drive { |
24 | 24 |
(...skipping 15 matching lines...) Expand all Loading... |
40 ~SearchOperation(); | 40 ~SearchOperation(); |
41 | 41 |
42 // Performs server side content search operation for |search_query|. | 42 // Performs server side content search operation for |search_query|. |
43 // If |next_feed| is set, this is the feed url that will be fetched. | 43 // If |next_feed| is set, this is the feed url that will be fetched. |
44 // Upon completion, |callback| will be called with the result. | 44 // Upon completion, |callback| will be called with the result. |
45 // This is implementation of FileSystemInterface::Search() method. | 45 // This is implementation of FileSystemInterface::Search() method. |
46 // | 46 // |
47 // |callback| must not be null. | 47 // |callback| must not be null. |
48 void Search(const std::string& search_query, | 48 void Search(const std::string& search_query, |
49 const GURL& next_feed, | 49 const GURL& next_feed, |
50 const SearchOperationCallback& callback); | 50 const SearchCallback& callback); |
51 | 51 |
52 private: | 52 private: |
53 // Part of Search(). This is called after the ResourceList is fetched from | 53 // Part of Search(). This is called after the ResourceList is fetched from |
54 // the server. | 54 // the server. |
55 void SearchAfterGetResourceList( | 55 void SearchAfterGetResourceList( |
56 const SearchOperationCallback& callback, | 56 const SearchCallback& callback, |
57 google_apis::GDataErrorCode gdata_error, | 57 google_apis::GDataErrorCode gdata_error, |
58 scoped_ptr<google_apis::ResourceList> resource_list); | 58 scoped_ptr<google_apis::ResourceList> resource_list); |
59 | 59 |
60 // Part of Search(). This is called after the RefreshEntryOnBlockingPool | 60 // Part of Search(). This is called after the RefreshEntryOnBlockingPool |
61 // is completed. | 61 // is completed. |
62 void SearchAfterRefreshEntry( | 62 void SearchAfterRefreshEntry( |
63 const SearchOperationCallback& callback, | 63 const SearchCallback& callback, |
64 const GURL& next_feed, | 64 const GURL& next_feed, |
65 scoped_ptr<std::vector<SearchResultInfo> > result, | 65 scoped_ptr<std::vector<SearchResultInfo> > result, |
66 FileError error); | 66 FileError error); |
67 | 67 |
68 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 68 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
69 JobScheduler* scheduler_; | 69 JobScheduler* scheduler_; |
70 internal::ResourceMetadata* metadata_; | 70 internal::ResourceMetadata* metadata_; |
71 | 71 |
72 // Note: This should remain the last member so it'll be destroyed and | 72 // Note: This should remain the last member so it'll be destroyed and |
73 // invalidate the weak pointers before any other members are destroyed. | 73 // invalidate the weak pointers before any other members are destroyed. |
74 base::WeakPtrFactory<SearchOperation> weak_ptr_factory_; | 74 base::WeakPtrFactory<SearchOperation> weak_ptr_factory_; |
75 DISALLOW_COPY_AND_ASSIGN(SearchOperation); | 75 DISALLOW_COPY_AND_ASSIGN(SearchOperation); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace file_system | 78 } // namespace file_system |
79 } // namespace drive | 79 } // namespace drive |
80 | 80 |
81 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_SEARCH_OPERATION_H_ |
OLD | NEW |