2010-10-16 21:10:11 +02:00
|
|
|
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_DOWNLOAD_HANDLER_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_DOWNLOAD_HANDLER_H_
|
|
|
|
#pragma once
|
2010-10-28 22:38:27 +02:00
|
|
|
|
2011-12-23 18:36:30 +01:00
|
|
|
#include "include/cef_base.h"
|
|
|
|
|
|
|
|
class CefDownloadHandler;
|
2010-10-16 21:10:11 +02:00
|
|
|
|
|
|
|
// Implement this interface to receive download notifications.
|
2012-01-10 00:46:23 +01:00
|
|
|
class DownloadListener : public virtual CefBase {
|
|
|
|
public:
|
2010-10-16 21:10:11 +02:00
|
|
|
// Called when the download is complete.
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void NotifyDownloadComplete(const CefString& fileName) =0;
|
2010-10-16 21:10:11 +02:00
|
|
|
|
|
|
|
// Called if the download fails.
|
2010-11-22 18:49:46 +01:00
|
|
|
virtual void NotifyDownloadError(const CefString& fileName) =0;
|
2010-10-16 21:10:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Create a new download handler to manage download of a single file.
|
|
|
|
CefRefPtr<CefDownloadHandler> CreateDownloadHandler(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefRefPtr<DownloadListener> listener, const CefString& fileName);
|
2010-10-28 22:38:27 +02:00
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_DOWNLOAD_HANDLER_H_
|