OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Various factors are considered, such as the type of the file, whether a | 139 // Various factors are considered, such as the type of the file, whether a |
140 // user action initiated the download, and whether the user has explicitly | 140 // user action initiated the download, and whether the user has explicitly |
141 // marked the file type as "auto open". | 141 // marked the file type as "auto open". |
142 bool IsDangerousFile(const content::DownloadItem& download, | 142 bool IsDangerousFile(const content::DownloadItem& download, |
143 const DownloadStateInfo& state, | 143 const DownloadStateInfo& state, |
144 bool visited_referrer_before); | 144 bool visited_referrer_before); |
145 | 145 |
146 // Callback from history system. | 146 // Callback from history system. |
147 void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle); | 147 void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle); |
148 | 148 |
| 149 // Check policy of whether we should open this download with a web intents |
| 150 // dispatch. |
| 151 bool ShouldOpenWithWebIntents(const content::DownloadItem* item); |
| 152 |
| 153 // Open the given item with a web intent dispatch. |
| 154 void OpenWithWebIntent(const content::DownloadItem* item); |
| 155 |
149 Profile* profile_; | 156 Profile* profile_; |
150 int next_download_id_; | 157 int next_download_id_; |
151 scoped_ptr<DownloadPrefs> download_prefs_; | 158 scoped_ptr<DownloadPrefs> download_prefs_; |
152 scoped_ptr<DownloadHistory> download_history_; | 159 scoped_ptr<DownloadHistory> download_history_; |
153 | 160 |
154 // Maps from pending extension installations to DownloadItem IDs. | 161 // Maps from pending extension installations to DownloadItem IDs. |
155 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; | 162 typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap; |
156 CrxInstallerMap crx_installers_; | 163 CrxInstallerMap crx_installers_; |
157 | 164 |
158 content::NotificationRegistrar registrar_; | 165 content::NotificationRegistrar registrar_; |
159 | 166 |
160 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 167 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
161 }; | 168 }; |
162 | 169 |
163 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 170 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |