15c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Copyright 2014 The Chromium Authors. All rights reserved. 25c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Use of this source code is governed by a BSD-style license that can be 35c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// found in the LICENSE file. 45c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu 55f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "sync/internal_api/public/attachments/attachment_downloader.h" 65c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu 7116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include "sync/internal_api/public/attachments/attachment_downloader_impl.h" 8116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)namespace syncer { 10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)AttachmentDownloader::~AttachmentDownloader() { 125c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu} 13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 14116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Factory function for creating AttachmentDownloaderImpl. 15116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// It is introduced to avoid SYNC_EXPORT-ing AttachmentDownloaderImpl since it 16116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// inherits from OAuth2TokenService::Consumer which is not exported. 17116680a4aac90f2aa7413d9095a592090648e557Ben Murdochscoped_ptr<AttachmentDownloader> AttachmentDownloader::Create( 18116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch const GURL& sync_service_url, 19116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch const scoped_refptr<net::URLRequestContextGetter>& 20116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch url_request_context_getter, 21116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch const std::string& account_id, 22116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch const OAuth2TokenService::ScopeSet scopes, 236e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& 24116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch token_service_provider) { 25116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch return scoped_ptr<AttachmentDownloader>( 26116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch new AttachmentDownloaderImpl(sync_service_url, 27116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch url_request_context_getter, 28116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch account_id, 29116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch scopes, 306e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) token_service_provider)); 31116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch} 32116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch 33cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)} // namespace syncer 34