download_controller_android.h revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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.
4
5#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_
6#define CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_
7
8#include "content/common/content_export.h"
9
10namespace content {
11class DownloadItem;
12class RenderViewHost;
13class WebContents;
14
15// Interface to request GET downloads and send notifications for POST
16// downloads.
17class CONTENT_EXPORT DownloadControllerAndroid {
18 public:
19  // Returns the singleton instance of the DownloadControllerAndroid.
20  static DownloadControllerAndroid* Get();
21
22  // Starts a new download request with Android. Should be called on the
23  // UI thread.
24  virtual void CreateGETDownload(RenderViewHost* source, int request_id) = 0;
25
26  // Should be called when a POST download is started. Notifies the embedding
27  // app about the download. Should be called on the UI thread.
28  virtual void OnPostDownloadStarted(DownloadItem* download_item) = 0;
29 protected:
30  virtual ~DownloadControllerAndroid() {};
31};
32
33}  // namespace content
34
35#endif  // CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_
36