OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "google_apis/gaia/oauth2_token_service_request.h" | 10 #include "google_apis/gaia/oauth2_token_service_request.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // Download attachment referred by |attachment_id| and invoke |callback| when | 35 // Download attachment referred by |attachment_id| and invoke |callback| when |
36 // done. | 36 // done. |
37 // | 37 // |
38 // |callback| will receive a DownloadResult code and an Attachment object. If | 38 // |callback| will receive a DownloadResult code and an Attachment object. If |
39 // DownloadResult is not DOWNLOAD_SUCCESS then attachment pointer is NULL. | 39 // DownloadResult is not DOWNLOAD_SUCCESS then attachment pointer is NULL. |
40 virtual void DownloadAttachment(const AttachmentId& attachment_id, | 40 virtual void DownloadAttachment(const AttachmentId& attachment_id, |
41 const DownloadCallback& callback) = 0; | 41 const DownloadCallback& callback) = 0; |
42 | 42 |
43 // Create instance of AttachmentDownloaderImpl. | 43 // Create instance of AttachmentDownloaderImpl. |
44 // |url_prefix| is the URL prefix (including trailing slash) to be used when | 44 // |sync_service_url| is the URL of the sync service. |
45 // downloading attachments. | |
46 // | 45 // |
47 // |url_request_context_getter| provides a URLRequestContext. | 46 // |url_request_context_getter| provides a URLRequestContext. |
48 // | 47 // |
49 // |account_id| is the account id to use for downloads. | 48 // |account_id| is the account id to use for downloads. |
50 // | 49 // |
51 // |scopes| is the set of scopes to use for downloads. | 50 // |scopes| is the set of scopes to use for downloads. |
52 // | 51 // |
53 // |token_service_provider| provides an OAuth2 token service. | 52 // |token_service_provider| provides an OAuth2 token service. |
54 static scoped_ptr<AttachmentDownloader> Create( | 53 static scoped_ptr<AttachmentDownloader> Create( |
55 const std::string& url_prefix, | 54 const GURL& sync_service_url, |
56 const scoped_refptr<net::URLRequestContextGetter>& | 55 const scoped_refptr<net::URLRequestContextGetter>& |
57 url_request_context_getter, | 56 url_request_context_getter, |
58 const std::string& account_id, | 57 const std::string& account_id, |
59 const OAuth2TokenService::ScopeSet scopes, | 58 const OAuth2TokenService::ScopeSet scopes, |
60 scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider> | 59 scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider> |
61 token_service_provider); | 60 token_service_provider); |
62 }; | 61 }; |
63 | 62 |
64 } // namespace syncer | 63 } // namespace syncer |
65 | 64 |
66 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 65 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
OLD | NEW |