Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: chrome/browser/android/download/download_controller_android_impl.h

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DownloadControllerAndroid(Impl) to chrome/ Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download/download_controller_android_impl.h
diff --git a/content/browser/android/download_controller_android_impl.h b/chrome/browser/android/download/download_controller_android_impl.h
similarity index 79%
rename from content/browser/android/download_controller_android_impl.h
rename to chrome/browser/android/download/download_controller_android_impl.h
index 133c1029092550e69e1e4686e69fefabc23a5eaf..b68d4b99c73156f53669a0d20470956ee2a7705e 100644
--- a/content/browser/android/download_controller_android_impl.h
+++ b/chrome/browser/android/download/download_controller_android_impl.h
@@ -16,20 +16,21 @@
// DownloadListener2.requestHttpGetDownload()
//
-#ifndef CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_
-#define CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_
-
-#include <string>
+#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_
#include <stdint.h>
+#include <string>
+
#include "base/android/jni_weak_ref.h"
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/singleton.h"
-#include "content/public/browser/android/download_controller_android.h"
+#include "chrome/browser/android/download/download_controller_android.h"
+#include "chrome/browser/ui/android/view_android_helper.h"
#include "net/cookies/cookie_monster.h"
#include "url/gurl.h"
@@ -37,11 +38,15 @@ namespace net {
class URLRequest;
}
+namespace ui {
+class WindowAndroid;
+}
+
namespace content {
struct GlobalRequestID;
-class DeferredDownloadObserver;
class RenderViewHost;
class WebContents;
+}
class DownloadControllerAndroidImpl : public DownloadControllerAndroid {
no sievers 2016/06/07 21:35:23 nit: I think this could just be DownloadController
Jinsuk Kim 2016/06/08 06:29:08 Done.
public:
@@ -52,12 +57,9 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid {
// Called when DownloadController Java object is instantiated.
void Init(JNIEnv* env, jobject obj);
- // Removes a deferred download from |deferred_downloads_|.
- void CancelDeferredDownload(DeferredDownloadObserver* observer);
-
// DownloadControllerAndroid implementation.
void AcquireFileAccessPermission(
- WebContents* web_contents,
+ content::WebContents* web_contents,
const AcquireFileAccessPermissionCallback& callback) override;
void SetDefaultDownloadFileName(const std::string& file_name) override;
@@ -81,7 +83,7 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid {
std::string referer;
bool has_user_gesture;
- WebContents* web_contents;
+ content::WebContents* web_contents;
// Default copy constructor is used for passing this struct by value.
};
struct JavaObject;
@@ -90,37 +92,36 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid {
~DownloadControllerAndroidImpl() override;
// Helper method for implementing AcquireFileAccessPermission().
- bool HasFileAccessPermission(
- base::android::ScopedJavaLocalRef<jobject> j_content_view_core);
+ bool HasFileAccessPermission(ui::WindowAndroid* window_android);
// DownloadControllerAndroid implementation.
void CreateGETDownload(int render_process_id,
int render_view_id,
int request_id,
bool must_download) override;
- void OnDownloadStarted(DownloadItem* download_item) override;
- void StartContextMenuDownload(const ContextMenuParams& params,
- WebContents* web_contents,
+ void OnDownloadStarted(content::DownloadItem* download_item) override;
+ void StartContextMenuDownload(const content::ContextMenuParams& params,
+ content::WebContents* web_contents,
bool is_link,
const std::string& extra_headers) override;
- void DangerousDownloadValidated(WebContents* web_contents,
+ void DangerousDownloadValidated(content::WebContents* web_contents,
const std::string& download_guid,
bool accept) override;
// DownloadItem::Observer interface.
- void OnDownloadUpdated(DownloadItem* item) override;
+ void OnDownloadUpdated(content::DownloadItem* item) override;
typedef base::Callback<void(const DownloadInfoAndroid&)>
GetDownloadInfoCB;
- void PrepareDownloadInfo(const GlobalRequestID& global_id,
+ void PrepareDownloadInfo(const content::GlobalRequestID& global_id,
const GetDownloadInfoCB& callback);
void CheckPolicyAndLoadCookies(const DownloadInfoAndroid& info,
const GetDownloadInfoCB& callback,
- const GlobalRequestID& global_id,
+ const content::GlobalRequestID& global_id,
const net::CookieList& cookie_list);
void DoLoadCookies(const DownloadInfoAndroid& info,
const GetDownloadInfoCB& callback,
- const GlobalRequestID& global_id);
+ const content::GlobalRequestID& global_id);
void OnCookieResponse(DownloadInfoAndroid info,
const GetDownloadInfoCB& callback,
const std::string& cookie);
@@ -137,10 +138,10 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid {
bool allowed);
// The download item contains dangerous file types.
- void OnDangerousDownload(DownloadItem *item);
+ void OnDangerousDownload(content::DownloadItem *item);
base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents(
- WebContents* web_contents);
+ content::WebContents* web_contents);
// Creates Java object if it is not created already and returns it.
JavaObject* GetJavaObject();
@@ -149,11 +150,7 @@ class DownloadControllerAndroidImpl : public DownloadControllerAndroid {
std::string default_file_name_;
- ScopedVector<DeferredDownloadObserver> deferred_downloads_;
-
DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl);
};
-} // namespace content
-
-#endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698