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_WAPI_FEED_LOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_LOADER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_LOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_LOADER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // Should we stop after getting first feed chunk, even if there is more | 41 // Should we stop after getting first feed chunk, even if there is more |
42 // data. | 42 // data. |
43 bool should_fetch_multiple_feeds; | 43 bool should_fetch_multiple_feeds; |
44 FilePath search_file_path; | 44 FilePath search_file_path; |
45 std::string search_query; | 45 std::string search_query; |
46 std::string directory_resource_id; | 46 std::string directory_resource_id; |
47 FindEntryCallback callback; | 47 FindEntryCallback callback; |
48 scoped_ptr<GetDocumentsUiState> ui_state; | 48 scoped_ptr<GetDocumentsUiState> ui_state; |
49 }; | 49 }; |
50 | 50 |
| 51 // Defines set of parameters sent to callback OnProtoLoaded(). |
| 52 struct LoadRootFeedParams { |
| 53 LoadRootFeedParams( |
| 54 FilePath search_file_path, |
| 55 bool should_load_from_server, |
| 56 const FindEntryCallback& callback); |
| 57 ~LoadRootFeedParams(); |
| 58 |
| 59 FilePath search_file_path; |
| 60 bool should_load_from_server; |
| 61 std::string proto; |
| 62 GDataFileError load_error; |
| 63 base::Time last_modified; |
| 64 // Time when filesystem began to be loaded from disk. |
| 65 base::Time load_start_time; |
| 66 const FindEntryCallback callback; |
| 67 }; |
| 68 |
51 // Callback run as a response to LoadFromServer. | 69 // Callback run as a response to LoadFromServer. |
52 typedef base::Callback<void(GetDocumentsParams* params, | 70 typedef base::Callback<void(GetDocumentsParams* params, |
53 GDataFileError error)> | 71 GDataFileError error)> |
54 LoadDocumentFeedCallback; | 72 LoadDocumentFeedCallback; |
55 | 73 |
56 // GDataWapiFeedLoader is used to load feeds from WAPI (codename for | 74 // GDataWapiFeedLoader is used to load feeds from WAPI (codename for |
57 // Documents List API) and load the cached proto file. | 75 // Documents List API) and load the cached proto file. |
58 class GDataWapiFeedLoader { | 76 class GDataWapiFeedLoader { |
59 public: | 77 public: |
60 // Used to notify events from the loader. | 78 // Used to notify events from the loader. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 215 |
198 // Note: This should remain the last member so it'll be destroyed and | 216 // Note: This should remain the last member so it'll be destroyed and |
199 // invalidate its weak pointers before any other members are destroyed. | 217 // invalidate its weak pointers before any other members are destroyed. |
200 base::WeakPtrFactory<GDataWapiFeedLoader> weak_ptr_factory_; | 218 base::WeakPtrFactory<GDataWapiFeedLoader> weak_ptr_factory_; |
201 DISALLOW_COPY_AND_ASSIGN(GDataWapiFeedLoader); | 219 DISALLOW_COPY_AND_ASSIGN(GDataWapiFeedLoader); |
202 }; | 220 }; |
203 | 221 |
204 } // namespace gdata | 222 } // namespace gdata |
205 | 223 |
206 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_LOADER_H_ | 224 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_WAPI_FEED_LOADER_H_ |
OLD | NEW |