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_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/chromeos/gdata/operations_base.h" | 11 #include "chrome/browser/chromeos/gdata/operations_base.h" |
12 | 12 |
13 namespace gdata { | 13 namespace gdata { |
14 | 14 |
15 //============================ GetDocumentsOperation =========================== | 15 //============================ GetDocumentsOperation =========================== |
16 | 16 |
17 // This class performs the operation for fetching a document list. | 17 // This class performs the operation for fetching a document list. |
18 class GetDocumentsOperation : public GetDataOperation { | 18 class GetDocumentsOperation : public GetDataOperation { |
19 public: | 19 public: |
20 GetDocumentsOperation(GDataOperationRegistry* registry, | 20 GetDocumentsOperation(GDataOperationRegistry* registry, |
21 Profile* profile, | |
22 int start_changestamp, | 21 int start_changestamp, |
23 const std::string& search_string, | 22 const std::string& search_string, |
24 const std::string& directory_resource_id, | 23 const std::string& directory_resource_id, |
25 const GetDataCallback& callback); | 24 const GetDataCallback& callback); |
26 virtual ~GetDocumentsOperation(); | 25 virtual ~GetDocumentsOperation(); |
27 | 26 |
28 // Sets |url| for document fetching operation. This URL should be set in use | 27 // Sets |url| for document fetching operation. This URL should be set in use |
29 // case when additional 'pages' of document lists are being fetched. | 28 // case when additional 'pages' of document lists are being fetched. |
30 void SetUrl(const GURL& url); | 29 void SetUrl(const GURL& url); |
31 | 30 |
32 protected: | 31 protected: |
33 // Overridden from GetDataOperation. | 32 // Overridden from GetDataOperation. |
34 virtual GURL GetURL() const OVERRIDE; | 33 virtual GURL GetURL() const OVERRIDE; |
35 | 34 |
36 private: | 35 private: |
37 GURL override_url_; | 36 GURL override_url_; |
38 int start_changestamp_; | 37 int start_changestamp_; |
39 std::string search_string_; | 38 std::string search_string_; |
40 std::string directory_resource_id_; | 39 std::string directory_resource_id_; |
41 | 40 |
42 DISALLOW_COPY_AND_ASSIGN(GetDocumentsOperation); | 41 DISALLOW_COPY_AND_ASSIGN(GetDocumentsOperation); |
43 }; | 42 }; |
44 | 43 |
45 //========================= GetDocumentEntryOperation ========================== | 44 //========================= GetDocumentEntryOperation ========================== |
46 | 45 |
47 // This class performs the operation for fetching a single document entry. | 46 // This class performs the operation for fetching a single document entry. |
48 class GetDocumentEntryOperation : public GetDataOperation { | 47 class GetDocumentEntryOperation : public GetDataOperation { |
49 public: | 48 public: |
50 GetDocumentEntryOperation(GDataOperationRegistry* registry, | 49 GetDocumentEntryOperation(GDataOperationRegistry* registry, |
51 Profile* profile, | |
52 const std::string& resource_id, | 50 const std::string& resource_id, |
53 const GetDataCallback& callback); | 51 const GetDataCallback& callback); |
54 virtual ~GetDocumentEntryOperation(); | 52 virtual ~GetDocumentEntryOperation(); |
55 | 53 |
56 protected: | 54 protected: |
57 // Overridden from GetGdataOperation. | 55 // Overridden from GetGdataOperation. |
58 virtual GURL GetURL() const OVERRIDE; | 56 virtual GURL GetURL() const OVERRIDE; |
59 | 57 |
60 private: | 58 private: |
61 // Resource id of the requested entry. | 59 // Resource id of the requested entry. |
62 std::string resource_id_; | 60 std::string resource_id_; |
63 | 61 |
64 DISALLOW_COPY_AND_ASSIGN(GetDocumentEntryOperation); | 62 DISALLOW_COPY_AND_ASSIGN(GetDocumentEntryOperation); |
65 }; | 63 }; |
66 | 64 |
67 //========================= GetAccountMetadataOperation ======================== | 65 //========================= GetAccountMetadataOperation ======================== |
68 | 66 |
69 // This class performs the operation for fetching account metadata. | 67 // This class performs the operation for fetching account metadata. |
70 class GetAccountMetadataOperation : public GetDataOperation { | 68 class GetAccountMetadataOperation : public GetDataOperation { |
71 public: | 69 public: |
72 GetAccountMetadataOperation(GDataOperationRegistry* registry, | 70 GetAccountMetadataOperation(GDataOperationRegistry* registry, |
73 Profile* profile, | |
74 const GetDataCallback& callback); | 71 const GetDataCallback& callback); |
75 virtual ~GetAccountMetadataOperation(); | 72 virtual ~GetAccountMetadataOperation(); |
76 | 73 |
77 protected: | 74 protected: |
78 // Overridden from GetDataOperation. | 75 // Overridden from GetDataOperation. |
79 virtual GURL GetURL() const OVERRIDE; | 76 virtual GURL GetURL() const OVERRIDE; |
80 | 77 |
81 private: | 78 private: |
82 DISALLOW_COPY_AND_ASSIGN(GetAccountMetadataOperation); | 79 DISALLOW_COPY_AND_ASSIGN(GetAccountMetadataOperation); |
83 }; | 80 }; |
84 | 81 |
85 //============================ DownloadFileOperation =========================== | 82 //============================ DownloadFileOperation =========================== |
86 | 83 |
87 // This class performs the operation for downloading of a given document/file. | 84 // This class performs the operation for downloading of a given document/file. |
88 class DownloadFileOperation : public UrlFetchOperationBase { | 85 class DownloadFileOperation : public UrlFetchOperationBase { |
89 public: | 86 public: |
90 DownloadFileOperation( | 87 DownloadFileOperation( |
91 GDataOperationRegistry* registry, | 88 GDataOperationRegistry* registry, |
92 Profile* profile, | |
93 const DownloadActionCallback& download_action_callback, | 89 const DownloadActionCallback& download_action_callback, |
94 const GetDownloadDataCallback& get_download_data_callback, | 90 const GetDownloadDataCallback& get_download_data_callback, |
95 const GURL& document_url, | 91 const GURL& document_url, |
96 const FilePath& virtual_path, | 92 const FilePath& virtual_path, |
97 const FilePath& output_file_path); | 93 const FilePath& output_file_path); |
98 virtual ~DownloadFileOperation(); | 94 virtual ~DownloadFileOperation(); |
99 | 95 |
100 protected: | 96 protected: |
101 // Overridden from UrlFetchOperationBase. | 97 // Overridden from UrlFetchOperationBase. |
102 virtual GURL GetURL() const OVERRIDE; | 98 virtual GURL GetURL() const OVERRIDE; |
(...skipping 15 matching lines...) Expand all Loading... |
118 | 114 |
119 DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation); | 115 DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation); |
120 }; | 116 }; |
121 | 117 |
122 //=========================== DeleteDocumentOperation ========================== | 118 //=========================== DeleteDocumentOperation ========================== |
123 | 119 |
124 // This class performs the operation for deleting a document. | 120 // This class performs the operation for deleting a document. |
125 class DeleteDocumentOperation : public EntryActionOperation { | 121 class DeleteDocumentOperation : public EntryActionOperation { |
126 public: | 122 public: |
127 DeleteDocumentOperation(GDataOperationRegistry* registry, | 123 DeleteDocumentOperation(GDataOperationRegistry* registry, |
128 Profile* profile, | |
129 const EntryActionCallback& callback, | 124 const EntryActionCallback& callback, |
130 const GURL& document_url); | 125 const GURL& document_url); |
131 virtual ~DeleteDocumentOperation(); | 126 virtual ~DeleteDocumentOperation(); |
132 | 127 |
133 protected: | 128 protected: |
134 // Overridden from UrlFetchOperationBase. | 129 // Overridden from UrlFetchOperationBase. |
135 virtual GURL GetURL() const OVERRIDE; | 130 virtual GURL GetURL() const OVERRIDE; |
136 | 131 |
137 // Overridden from EntryActionOperation. | 132 // Overridden from EntryActionOperation. |
138 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 133 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
139 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 134 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
140 | 135 |
141 private: | 136 private: |
142 DISALLOW_COPY_AND_ASSIGN(DeleteDocumentOperation); | 137 DISALLOW_COPY_AND_ASSIGN(DeleteDocumentOperation); |
143 }; | 138 }; |
144 | 139 |
145 //========================== CreateDirectoryOperation ========================== | 140 //========================== CreateDirectoryOperation ========================== |
146 | 141 |
147 // This class performs the operation for creating a directory. | 142 // This class performs the operation for creating a directory. |
148 class CreateDirectoryOperation : public GetDataOperation { | 143 class CreateDirectoryOperation : public GetDataOperation { |
149 public: | 144 public: |
150 // Empty |parent_content_url| will create the directory in the root folder. | 145 // Empty |parent_content_url| will create the directory in the root folder. |
151 CreateDirectoryOperation(GDataOperationRegistry* registry, | 146 CreateDirectoryOperation(GDataOperationRegistry* registry, |
152 Profile* profile, | |
153 const GetDataCallback& callback, | 147 const GetDataCallback& callback, |
154 const GURL& parent_content_url, | 148 const GURL& parent_content_url, |
155 const FilePath::StringType& directory_name); | 149 const FilePath::StringType& directory_name); |
156 virtual ~CreateDirectoryOperation(); | 150 virtual ~CreateDirectoryOperation(); |
157 | 151 |
158 protected: | 152 protected: |
159 // Overridden from UrlFetchOperationBase. | 153 // Overridden from UrlFetchOperationBase. |
160 virtual GURL GetURL() const OVERRIDE; | 154 virtual GURL GetURL() const OVERRIDE; |
161 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 155 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
162 | 156 |
163 // Overridden from UrlFetchOperationBase. | 157 // Overridden from UrlFetchOperationBase. |
164 virtual bool GetContentData(std::string* upload_content_type, | 158 virtual bool GetContentData(std::string* upload_content_type, |
165 std::string* upload_content) OVERRIDE; | 159 std::string* upload_content) OVERRIDE; |
166 | 160 |
167 private: | 161 private: |
168 GURL parent_content_url_; | 162 GURL parent_content_url_; |
169 FilePath::StringType directory_name_; | 163 FilePath::StringType directory_name_; |
170 | 164 |
171 DISALLOW_COPY_AND_ASSIGN(CreateDirectoryOperation); | 165 DISALLOW_COPY_AND_ASSIGN(CreateDirectoryOperation); |
172 }; | 166 }; |
173 | 167 |
174 //============================ CopyDocumentOperation =========================== | 168 //============================ CopyDocumentOperation =========================== |
175 | 169 |
176 // This class performs the operation for making a copy of a document. | 170 // This class performs the operation for making a copy of a document. |
177 class CopyDocumentOperation : public GetDataOperation { | 171 class CopyDocumentOperation : public GetDataOperation { |
178 public: | 172 public: |
179 CopyDocumentOperation(GDataOperationRegistry* registry, | 173 CopyDocumentOperation(GDataOperationRegistry* registry, |
180 Profile* profile, | |
181 const GetDataCallback& callback, | 174 const GetDataCallback& callback, |
182 const std::string& resource_id, | 175 const std::string& resource_id, |
183 const FilePath::StringType& new_name); | 176 const FilePath::StringType& new_name); |
184 virtual ~CopyDocumentOperation(); | 177 virtual ~CopyDocumentOperation(); |
185 | 178 |
186 protected: | 179 protected: |
187 // Overridden from GetDataOperation. | 180 // Overridden from GetDataOperation. |
188 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 181 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
189 | 182 |
190 // Overridden from UrlFetchOperationBase. | 183 // Overridden from UrlFetchOperationBase. |
191 virtual GURL GetURL() const OVERRIDE; | 184 virtual GURL GetURL() const OVERRIDE; |
192 virtual bool GetContentData(std::string* upload_content_type, | 185 virtual bool GetContentData(std::string* upload_content_type, |
193 std::string* upload_content) OVERRIDE; | 186 std::string* upload_content) OVERRIDE; |
194 | 187 |
195 private: | 188 private: |
196 std::string resource_id_; | 189 std::string resource_id_; |
197 FilePath::StringType new_name_; | 190 FilePath::StringType new_name_; |
198 | 191 |
199 DISALLOW_COPY_AND_ASSIGN(CopyDocumentOperation); | 192 DISALLOW_COPY_AND_ASSIGN(CopyDocumentOperation); |
200 }; | 193 }; |
201 | 194 |
202 //=========================== RenameResourceOperation ========================== | 195 //=========================== RenameResourceOperation ========================== |
203 | 196 |
204 // This class performs the operation for renaming a document/file/directory. | 197 // This class performs the operation for renaming a document/file/directory. |
205 class RenameResourceOperation : public EntryActionOperation { | 198 class RenameResourceOperation : public EntryActionOperation { |
206 public: | 199 public: |
207 RenameResourceOperation(GDataOperationRegistry* registry, | 200 RenameResourceOperation(GDataOperationRegistry* registry, |
208 Profile* profile, | |
209 const EntryActionCallback& callback, | 201 const EntryActionCallback& callback, |
210 const GURL& document_url, | 202 const GURL& document_url, |
211 const FilePath::StringType& new_name); | 203 const FilePath::StringType& new_name); |
212 virtual ~RenameResourceOperation(); | 204 virtual ~RenameResourceOperation(); |
213 | 205 |
214 protected: | 206 protected: |
215 // Overridden from EntryActionOperation. | 207 // Overridden from EntryActionOperation. |
216 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 208 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
217 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 209 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
218 | 210 |
219 // Overridden from UrlFetchOperationBase. | 211 // Overridden from UrlFetchOperationBase. |
220 virtual GURL GetURL() const OVERRIDE; | 212 virtual GURL GetURL() const OVERRIDE; |
221 virtual bool GetContentData(std::string* upload_content_type, | 213 virtual bool GetContentData(std::string* upload_content_type, |
222 std::string* upload_content) OVERRIDE; | 214 std::string* upload_content) OVERRIDE; |
223 | 215 |
224 private: | 216 private: |
225 FilePath::StringType new_name_; | 217 FilePath::StringType new_name_; |
226 | 218 |
227 DISALLOW_COPY_AND_ASSIGN(RenameResourceOperation); | 219 DISALLOW_COPY_AND_ASSIGN(RenameResourceOperation); |
228 }; | 220 }; |
229 | 221 |
230 //=========================== AuthorizeAppOperation ========================== | 222 //=========================== AuthorizeAppOperation ========================== |
231 | 223 |
232 // This class performs the operation for renaming a document/file/directory. | 224 // This class performs the operation for renaming a document/file/directory. |
233 class AuthorizeAppsOperation : public GetDataOperation { | 225 class AuthorizeAppsOperation : public GetDataOperation { |
234 public: | 226 public: |
235 AuthorizeAppsOperation(GDataOperationRegistry* registry, | 227 AuthorizeAppsOperation(GDataOperationRegistry* registry, |
236 Profile* profile, | |
237 const GetDataCallback& callback, | 228 const GetDataCallback& callback, |
238 const GURL& document_url, | 229 const GURL& document_url, |
239 const std::string& app_ids); | 230 const std::string& app_ids); |
240 virtual ~AuthorizeAppsOperation(); | 231 virtual ~AuthorizeAppsOperation(); |
241 protected: | 232 protected: |
242 // Overridden from EntryActionOperation. | 233 // Overridden from EntryActionOperation. |
243 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 234 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
244 | 235 |
245 // Overridden from UrlFetchOperationBase. | 236 // Overridden from UrlFetchOperationBase. |
246 virtual bool GetContentData(std::string* upload_content_type, | 237 virtual bool GetContentData(std::string* upload_content_type, |
(...skipping 15 matching lines...) Expand all Loading... |
262 DISALLOW_COPY_AND_ASSIGN(AuthorizeAppsOperation); | 253 DISALLOW_COPY_AND_ASSIGN(AuthorizeAppsOperation); |
263 }; | 254 }; |
264 | 255 |
265 //======================= AddResourceToDirectoryOperation ====================== | 256 //======================= AddResourceToDirectoryOperation ====================== |
266 | 257 |
267 // This class performs the operation for adding a document/file/directory | 258 // This class performs the operation for adding a document/file/directory |
268 // to a directory. | 259 // to a directory. |
269 class AddResourceToDirectoryOperation : public EntryActionOperation { | 260 class AddResourceToDirectoryOperation : public EntryActionOperation { |
270 public: | 261 public: |
271 AddResourceToDirectoryOperation(GDataOperationRegistry* registry, | 262 AddResourceToDirectoryOperation(GDataOperationRegistry* registry, |
272 Profile* profile, | |
273 const EntryActionCallback& callback, | 263 const EntryActionCallback& callback, |
274 const GURL& parent_content_url, | 264 const GURL& parent_content_url, |
275 const GURL& document_url); | 265 const GURL& document_url); |
276 virtual ~AddResourceToDirectoryOperation(); | 266 virtual ~AddResourceToDirectoryOperation(); |
277 | 267 |
278 protected: | 268 protected: |
279 // Overridden from UrlFetchOperationBase. | 269 // Overridden from UrlFetchOperationBase. |
280 virtual GURL GetURL() const OVERRIDE; | 270 virtual GURL GetURL() const OVERRIDE; |
281 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 271 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
282 virtual bool GetContentData(std::string* upload_content_type, | 272 virtual bool GetContentData(std::string* upload_content_type, |
283 std::string* upload_content) OVERRIDE; | 273 std::string* upload_content) OVERRIDE; |
284 | 274 |
285 private: | 275 private: |
286 GURL parent_content_url_; | 276 GURL parent_content_url_; |
287 | 277 |
288 DISALLOW_COPY_AND_ASSIGN(AddResourceToDirectoryOperation); | 278 DISALLOW_COPY_AND_ASSIGN(AddResourceToDirectoryOperation); |
289 }; | 279 }; |
290 | 280 |
291 //==================== RemoveResourceFromDirectoryOperation ==================== | 281 //==================== RemoveResourceFromDirectoryOperation ==================== |
292 | 282 |
293 // This class performs the operation for adding a document/file/directory | 283 // This class performs the operation for adding a document/file/directory |
294 // from a directory. | 284 // from a directory. |
295 class RemoveResourceFromDirectoryOperation : public EntryActionOperation { | 285 class RemoveResourceFromDirectoryOperation : public EntryActionOperation { |
296 public: | 286 public: |
297 RemoveResourceFromDirectoryOperation(GDataOperationRegistry* registry, | 287 RemoveResourceFromDirectoryOperation(GDataOperationRegistry* registry, |
298 Profile* profile, | |
299 const EntryActionCallback& callback, | 288 const EntryActionCallback& callback, |
300 const GURL& parent_content_url, | 289 const GURL& parent_content_url, |
301 const GURL& document_url, | 290 const GURL& document_url, |
302 const std::string& resource_id); | 291 const std::string& resource_id); |
303 virtual ~RemoveResourceFromDirectoryOperation(); | 292 virtual ~RemoveResourceFromDirectoryOperation(); |
304 | 293 |
305 protected: | 294 protected: |
306 // Overridden from UrlFetchOperationBase. | 295 // Overridden from UrlFetchOperationBase. |
307 virtual GURL GetURL() const OVERRIDE; | 296 virtual GURL GetURL() const OVERRIDE; |
308 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; | 297 virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; |
309 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; | 298 virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; |
310 | 299 |
311 private: | 300 private: |
312 std::string resource_id_; | 301 std::string resource_id_; |
313 GURL parent_content_url_; | 302 GURL parent_content_url_; |
314 | 303 |
315 DISALLOW_COPY_AND_ASSIGN(RemoveResourceFromDirectoryOperation); | 304 DISALLOW_COPY_AND_ASSIGN(RemoveResourceFromDirectoryOperation); |
316 }; | 305 }; |
317 | 306 |
318 //=========================== InitiateUploadOperation ========================== | 307 //=========================== InitiateUploadOperation ========================== |
319 | 308 |
320 // This class performs the operation for initiating the upload of a file. | 309 // This class performs the operation for initiating the upload of a file. |
321 class InitiateUploadOperation : public UrlFetchOperationBase { | 310 class InitiateUploadOperation : public UrlFetchOperationBase { |
322 public: | 311 public: |
323 InitiateUploadOperation(GDataOperationRegistry* registry, | 312 InitiateUploadOperation(GDataOperationRegistry* registry, |
324 Profile* profile, | |
325 const InitiateUploadCallback& callback, | 313 const InitiateUploadCallback& callback, |
326 const InitiateUploadParams& params); | 314 const InitiateUploadParams& params); |
327 virtual ~InitiateUploadOperation(); | 315 virtual ~InitiateUploadOperation(); |
328 | 316 |
329 protected: | 317 protected: |
330 // Overridden from UrlFetchOperationBase. | 318 // Overridden from UrlFetchOperationBase. |
331 virtual GURL GetURL() const OVERRIDE; | 319 virtual GURL GetURL() const OVERRIDE; |
332 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; | 320 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; |
333 virtual void NotifySuccessToOperationRegistry() OVERRIDE; | 321 virtual void NotifySuccessToOperationRegistry() OVERRIDE; |
334 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; | 322 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
346 | 334 |
347 DISALLOW_COPY_AND_ASSIGN(InitiateUploadOperation); | 335 DISALLOW_COPY_AND_ASSIGN(InitiateUploadOperation); |
348 }; | 336 }; |
349 | 337 |
350 //============================ ResumeUploadOperation =========================== | 338 //============================ ResumeUploadOperation =========================== |
351 | 339 |
352 // This class performs the operation for resuming the upload of a file. | 340 // This class performs the operation for resuming the upload of a file. |
353 class ResumeUploadOperation : public UrlFetchOperationBase { | 341 class ResumeUploadOperation : public UrlFetchOperationBase { |
354 public: | 342 public: |
355 ResumeUploadOperation(GDataOperationRegistry* registry, | 343 ResumeUploadOperation(GDataOperationRegistry* registry, |
356 Profile* profile, | |
357 const ResumeUploadCallback& callback, | 344 const ResumeUploadCallback& callback, |
358 const ResumeUploadParams& params); | 345 const ResumeUploadParams& params); |
359 virtual ~ResumeUploadOperation(); | 346 virtual ~ResumeUploadOperation(); |
360 | 347 |
361 protected: | 348 protected: |
362 // Overridden from UrlFetchOperationBase. | 349 // Overridden from UrlFetchOperationBase. |
363 virtual GURL GetURL() const OVERRIDE; | 350 virtual GURL GetURL() const OVERRIDE; |
364 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; | 351 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; |
365 virtual void NotifyStartToOperationRegistry() OVERRIDE; | 352 virtual void NotifyStartToOperationRegistry() OVERRIDE; |
366 virtual void NotifySuccessToOperationRegistry() OVERRIDE; | 353 virtual void NotifySuccessToOperationRegistry() OVERRIDE; |
(...skipping 16 matching lines...) Expand all Loading... |
383 | 370 |
384 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); | 371 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); |
385 }; | 372 }; |
386 | 373 |
387 //============================ GetContactsOperation ============================ | 374 //============================ GetContactsOperation ============================ |
388 | 375 |
389 // This class fetches a user's contacts. | 376 // This class fetches a user's contacts. |
390 class GetContactsOperation : public GetDataOperation { | 377 class GetContactsOperation : public GetDataOperation { |
391 public: | 378 public: |
392 GetContactsOperation(GDataOperationRegistry* registry, | 379 GetContactsOperation(GDataOperationRegistry* registry, |
393 Profile* profile, | |
394 const base::Time& min_update_time, | 380 const base::Time& min_update_time, |
395 const GetDataCallback& callback); | 381 const GetDataCallback& callback); |
396 virtual ~GetContactsOperation(); | 382 virtual ~GetContactsOperation(); |
397 | 383 |
398 void set_feed_url_for_testing(const GURL& url) { | 384 void set_feed_url_for_testing(const GURL& url) { |
399 feed_url_for_testing_ = url; | 385 feed_url_for_testing_ = url; |
400 } | 386 } |
401 | 387 |
402 protected: | 388 protected: |
403 // Overridden from GetDataOperation. | 389 // Overridden from GetDataOperation. |
404 virtual GURL GetURL() const OVERRIDE; | 390 virtual GURL GetURL() const OVERRIDE; |
405 | 391 |
406 private: | 392 private: |
407 // If non-empty, URL of the feed to fetch. | 393 // If non-empty, URL of the feed to fetch. |
408 GURL feed_url_for_testing_; | 394 GURL feed_url_for_testing_; |
409 | 395 |
410 // If is_null() is false, contains a minimum last-updated time that will be | 396 // If is_null() is false, contains a minimum last-updated time that will be |
411 // used to filter contacts. | 397 // used to filter contacts. |
412 base::Time min_update_time_; | 398 base::Time min_update_time_; |
413 | 399 |
414 DISALLOW_COPY_AND_ASSIGN(GetContactsOperation); | 400 DISALLOW_COPY_AND_ASSIGN(GetContactsOperation); |
415 }; | 401 }; |
416 | 402 |
417 //========================== GetContactPhotoOperation ========================== | 403 //========================== GetContactPhotoOperation ========================== |
418 | 404 |
419 // This class fetches a contact's photo. | 405 // This class fetches a contact's photo. |
420 class GetContactPhotoOperation : public UrlFetchOperationBase { | 406 class GetContactPhotoOperation : public UrlFetchOperationBase { |
421 public: | 407 public: |
422 GetContactPhotoOperation(GDataOperationRegistry* registry, | 408 GetContactPhotoOperation(GDataOperationRegistry* registry, |
423 Profile* profile, | |
424 const GURL& photo_url, | 409 const GURL& photo_url, |
425 const GetDownloadDataCallback& callback); | 410 const GetDownloadDataCallback& callback); |
426 virtual ~GetContactPhotoOperation(); | 411 virtual ~GetContactPhotoOperation(); |
427 | 412 |
428 protected: | 413 protected: |
429 // Overridden from UrlFetchOperationBase. | 414 // Overridden from UrlFetchOperationBase. |
430 virtual GURL GetURL() const OVERRIDE; | 415 virtual GURL GetURL() const OVERRIDE; |
431 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; | 416 virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; |
432 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; | 417 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; |
433 | 418 |
434 private: | 419 private: |
435 // Location of the photo to fetch. | 420 // Location of the photo to fetch. |
436 GURL photo_url_; | 421 GURL photo_url_; |
437 | 422 |
438 // Callback to which the photo data is passed. | 423 // Callback to which the photo data is passed. |
439 GetDownloadDataCallback callback_; | 424 GetDownloadDataCallback callback_; |
440 | 425 |
441 DISALLOW_COPY_AND_ASSIGN(GetContactPhotoOperation); | 426 DISALLOW_COPY_AND_ASSIGN(GetContactPhotoOperation); |
442 }; | 427 }; |
443 | 428 |
444 } // namespace gdata | 429 } // namespace gdata |
445 | 430 |
446 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ | 431 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ |
OLD | NEW |