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

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

Issue 2850223002: remove reliance on webcontents when requesting storage permission (Closed)
Patch Set: fix mock class Created 3 years, 7 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.h
diff --git a/chrome/browser/android/download/download_controller.h b/chrome/browser/android/download/download_controller.h
index f044b497e77e14d0b42493678f4aadd3b61dffd1..d085160a39f2f8502579524d00edb52eb5b8e3a9 100644
--- a/chrome/browser/android/download/download_controller.h
+++ b/chrome/browser/android/download/download_controller.h
@@ -23,10 +23,6 @@
#include "base/memory/singleton.h"
#include "chrome/browser/android/download/download_controller_base.h"
-namespace ui {
-class WindowAndroid;
-}
-
namespace content {
class WebContents;
}
@@ -42,7 +38,7 @@ class DownloadController : public DownloadControllerBase {
// DownloadControllerBase implementation.
void AcquireFileAccessPermission(
- content::WebContents* web_contents,
+ const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
const AcquireFileAccessPermissionCallback& callback) override;
void CreateAndroidDownload(
const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
@@ -65,6 +61,11 @@ class DownloadController : public DownloadControllerBase {
};
static void RecordDownloadCancelReason(DownloadCancelReason reason);
+ // Callback when user permission prompt finishes. Args: whether file access
+ // permission is acquired, which permission to update.
+ typedef base::Callback<void(bool, const std::string&)>
+ AcquirePermissionCallback;
+
private:
struct JavaObject;
friend struct base::DefaultSingletonTraits<DownloadController>;
@@ -72,7 +73,7 @@ class DownloadController : public DownloadControllerBase {
~DownloadController() override;
// Helper method for implementing AcquireFileAccessPermission().
- bool HasFileAccessPermission(ui::WindowAndroid* window_android);
+ bool HasFileAccessPermission();
// DownloadControllerBase implementation.
void OnDownloadStarted(content::DownloadItem* download_item) override;
« no previous file with comments | « chrome/browser/android/download/chrome_download_delegate.cc ('k') | chrome/browser/android/download/download_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698