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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_
8 #include "content/common/content_export.h"
9 #include "content/public/common/context_menu_params.h"
15 // Interface to request GET downloads and send notifications for POST
17 class CONTENT_EXPORT DownloadControllerAndroid
{
19 // Returns the singleton instance of the DownloadControllerAndroid.
20 static DownloadControllerAndroid
* Get();
22 // Starts a new download request with Android. Should be called on the
24 virtual void CreateGETDownload(int render_process_id
, int render_view_id
,
27 // Should be called when a download is started. It can be either a GET
28 // request with authentication or a POST request. Notifies the embedding
29 // app about the download. Should be called on the UI thread.
30 virtual void OnDownloadStarted(DownloadItem
* download_item
) = 0;
32 // Called when a download is initiated by context menu.
33 virtual void StartContextMenuDownload(
34 const ContextMenuParams
& params
, WebContents
* web_contents
,
37 // Called when a dangerous download item is verified or rejected.
38 virtual void DangerousDownloadValidated(
39 WebContents
* web_contents
, int download_id
, bool accept
) = 0;
42 virtual ~DownloadControllerAndroid() {};
45 } // namespace content
47 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_