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

Unified Diff: chrome/browser/chromeos/drive/download_handler.h

Issue 306023012: Enable Drive integration service in incognito windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments. Created 6 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/download_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/download_handler.h
diff --git a/chrome/browser/chromeos/drive/download_handler.h b/chrome/browser/chromeos/drive/download_handler.h
index 80d94a75ed9cd9716560dfdf902fb07611cd8ad1..ab5a17b099e009a93a3995ed7583d1efe2ad6edd 100644
--- a/chrome/browser/chromeos/drive/download_handler.h
+++ b/chrome/browser/chromeos/drive/download_handler.h
@@ -37,6 +37,12 @@ class DownloadHandler : public AllDownloadItemNotifier::Observer {
void Initialize(content::DownloadManager* download_manager,
const base::FilePath& drive_tmp_download_path);
+ // In addition to the DownloadManager passed to Initialize(), observe another
+ // download manager. This should be called only for the DownloadManager of the
+ // incognito version of the profile where |file_system_| resides.
+ void ObserveIncognitoDownloadManager(
+ content::DownloadManager* download_manager);
+
// Callback used to return results from SubstituteDriveDownloadPath.
// TODO(hashimoto): Report error with a FileError. crbug.com/171345
typedef base::Callback<void(const base::FilePath&)>
@@ -75,7 +81,7 @@ class DownloadHandler : public AllDownloadItemNotifier::Observer {
content::DownloadItem* download) OVERRIDE;
// Removes the download.
- void RemoveDownload(int id);
+ void RemoveDownload(void* manager_id, int id);
// Callback for FileSystem::CreateDirectory().
// Used to implement SubstituteDriveDownloadPath().
@@ -83,16 +89,24 @@ class DownloadHandler : public AllDownloadItemNotifier::Observer {
FileError error);
// Starts the upload of a downloaded/downloading file.
- void UploadDownloadItem(content::DownloadItem* download);
+ void UploadDownloadItem(content::DownloadManager* manager,
+ content::DownloadItem* download);
// Sets |cache_file_path| as user data of the download item specified by |id|.
- void SetCacheFilePath(int id,
+ void SetCacheFilePath(void* manager_id,
+ int id,
const base::FilePath* cache_file_path,
FileError error);
+ // Gets a download manager, given a |manager_id| casted from the pointer to
+ // the manager. This is used to validate the manager that may be deleted while
+ // asynchronous task posting. Returns NULL if the manager is already gone.
+ content::DownloadManager* GetDownloadManager(void* manager_id);
+
FileSystemInterface* file_system_; // Owned by DriveIntegrationService.
// Observe the DownloadManager for new downloads.
scoped_ptr<AllDownloadItemNotifier> notifier_;
+ scoped_ptr<AllDownloadItemNotifier> notifier_incognito_;
// Temporary download location directory.
base::FilePath drive_tmp_download_path_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/download_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698