#ifndef CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_
#define CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_
#include "base/basictypes.h"
#include "base/files/file.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "content/browser/download/drag_download_file.h"
#include "ui/base/dragdrop/download_file_interface.h"
class GURL;
namespace base {
class FilePath;
}
namespace content {
bool ParseDownloadMetadata(const base::string16& metadata,
base::string16* mime_type,
base::FilePath* file_name,
GURL* url);
CONTENT_EXPORT base::File CreateFileForDrop(base::FilePath* file_path);
class PromiseFileFinalizer : public ui::DownloadFileObserver {
public:
explicit PromiseFileFinalizer(DragDownloadFile* drag_file_downloader);
virtual void OnDownloadCompleted(const base::FilePath& file_path) OVERRIDE;
virtual void OnDownloadAborted() OVERRIDE;
protected:
virtual ~PromiseFileFinalizer();
private:
void Cleanup();
scoped_refptr<DragDownloadFile> drag_file_downloader_;
DISALLOW_COPY_AND_ASSIGN(PromiseFileFinalizer);
};
}
#endif