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

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate.h

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_
6 #define CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ 6 #define CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/hash_tables.h" 9 #include "base/hash_tables.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 content::DownloadItem* item, 68 content::DownloadItem* item,
69 const content::DownloadTargetCallback& callback) OVERRIDE; 69 const content::DownloadTargetCallback& callback) OVERRIDE;
70 virtual content::WebContents* 70 virtual content::WebContents*
71 GetAlternativeWebContentsToNotifyForDownload() OVERRIDE; 71 GetAlternativeWebContentsToNotifyForDownload() OVERRIDE;
72 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; 72 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE;
73 virtual bool ShouldCompleteDownload( 73 virtual bool ShouldCompleteDownload(
74 content::DownloadItem* item, 74 content::DownloadItem* item,
75 const base::Closure& complete_callback) OVERRIDE; 75 const base::Closure& complete_callback) OVERRIDE;
76 virtual bool ShouldOpenDownload(content::DownloadItem* item) OVERRIDE; 76 virtual bool ShouldOpenDownload(content::DownloadItem* item) OVERRIDE;
77 virtual bool GenerateFileHash() OVERRIDE; 77 virtual bool GenerateFileHash() OVERRIDE;
78 virtual void AddItemToPersistentStore(content::DownloadItem* item) OVERRIDE;
79 virtual void UpdateItemInPersistentStore(
80 content::DownloadItem* item) OVERRIDE;
81 virtual void UpdatePathForItemInPersistentStore(
82 content::DownloadItem* item,
83 const FilePath& new_path) OVERRIDE;
84 virtual void RemoveItemFromPersistentStore(
85 content::DownloadItem* item) OVERRIDE;
86 virtual void RemoveItemsFromPersistentStoreBetween(
87 base::Time remove_begin,
88 base::Time remove_end) OVERRIDE;
89 virtual void GetSaveDir(content::WebContents* web_contents, 78 virtual void GetSaveDir(content::WebContents* web_contents,
90 FilePath* website_save_dir, 79 FilePath* website_save_dir,
91 FilePath* download_save_dir, 80 FilePath* download_save_dir,
92 bool* skip_dir_check) OVERRIDE; 81 bool* skip_dir_check) OVERRIDE;
93 virtual void ChooseSavePath( 82 virtual void ChooseSavePath(
94 content::WebContents* web_contents, 83 content::WebContents* web_contents,
95 const FilePath& suggested_path, 84 const FilePath& suggested_path,
96 const FilePath::StringType& default_extension, 85 const FilePath::StringType& default_extension,
97 bool can_save_as_complete, 86 bool can_save_as_complete,
98 const content::SavePackagePathPickedCallback& callback) OVERRIDE; 87 const content::SavePackagePathPickedCallback& callback) OVERRIDE;
99 88
100 // Clears the last directory chosen by the user in response to a file chooser 89 // Clears the last directory chosen by the user in response to a file chooser
101 // prompt. Called when clearing recent history. 90 // prompt. Called when clearing recent history.
102 void ClearLastDownloadPath(); 91 void ClearLastDownloadPath();
103 92
104 DownloadPrefs* download_prefs() { return download_prefs_.get(); } 93 DownloadPrefs* download_prefs() { return download_prefs_.get(); }
105 DownloadHistory* download_history() { return download_history_.get(); }
106 94
107 protected: 95 protected:
108 // So that test classes can inherit from this for override purposes. 96 // So that test classes can inherit from this for override purposes.
109 virtual ~ChromeDownloadManagerDelegate(); 97 virtual ~ChromeDownloadManagerDelegate();
110 98
111 // Returns the SafeBrowsing download protection service if it's 99 // Returns the SafeBrowsing download protection service if it's
112 // enabled. Returns NULL otherwise. Protected virtual for testing. 100 // enabled. Returns NULL otherwise. Protected virtual for testing.
113 virtual safe_browsing::DownloadProtectionService* 101 virtual safe_browsing::DownloadProtectionService*
114 GetDownloadProtectionService(); 102 GetDownloadProtectionService();
115 103
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool reserved_path_verified); 194 bool reserved_path_verified);
207 195
208 // Called on the UI thread once the final target path is available. 196 // Called on the UI thread once the final target path is available.
209 void OnTargetPathDetermined( 197 void OnTargetPathDetermined(
210 int32 download_id, 198 int32 download_id,
211 const content::DownloadTargetCallback& callback, 199 const content::DownloadTargetCallback& callback,
212 content::DownloadItem::TargetDisposition disposition, 200 content::DownloadItem::TargetDisposition disposition,
213 content::DownloadDangerType danger_type, 201 content::DownloadDangerType danger_type,
214 const FilePath& target_path); 202 const FilePath& target_path);
215 203
216 // Callback from history system.
217 void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle);
218
219 // Check policy of whether we should open this download with a web intents 204 // Check policy of whether we should open this download with a web intents
220 // dispatch. 205 // dispatch.
221 bool ShouldOpenWithWebIntents(const content::DownloadItem* item); 206 bool ShouldOpenWithWebIntents(const content::DownloadItem* item);
222 207
223 // Open the given item with a web intent dispatch. 208 // Open the given item with a web intent dispatch.
224 void OpenWithWebIntent(const content::DownloadItem* item); 209 void OpenWithWebIntent(const content::DownloadItem* item);
225 210
226 // Internal gateways for ShouldCompleteDownload(). 211 // Internal gateways for ShouldCompleteDownload().
227 bool IsDownloadReadyForCompletion( 212 bool IsDownloadReadyForCompletion(
228 content::DownloadItem* item, 213 content::DownloadItem* item,
(...skipping 28 matching lines...) Expand all
257 #endif 242 #endif
258 243
259 // The directory most recently chosen by the user in response to a Save As 244 // The directory most recently chosen by the user in response to a Save As
260 // dialog for a regular download. 245 // dialog for a regular download.
261 FilePath last_download_path_; 246 FilePath last_download_path_;
262 247
263 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); 248 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate);
264 }; 249 };
265 250
266 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ 251 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698