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 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/flat_map.h" |
16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "chrome/browser/download/download_path_reservation_tracker.h" | 19 #include "chrome/browser/download/download_path_reservation_tracker.h" |
20 #include "chrome/browser/download/download_target_determiner_delegate.h" | 20 #include "chrome/browser/download/download_target_determiner_delegate.h" |
21 #include "chrome/browser/download/download_target_info.h" | 21 #include "chrome/browser/download/download_target_info.h" |
22 #include "chrome/browser/safe_browsing/download_protection_service.h" | 22 #include "chrome/browser/safe_browsing/download_protection_service.h" |
23 #include "content/public/browser/download_danger_type.h" | 23 #include "content/public/browser/download_danger_type.h" |
24 #include "content/public/browser/download_item.h" | 24 #include "content/public/browser/download_item.h" |
25 #include "content/public/browser/download_manager_delegate.h" | 25 #include "content/public/browser/download_manager_delegate.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // Returns true if |path| should open in the browser. | 163 // Returns true if |path| should open in the browser. |
164 bool IsOpenInBrowserPreferreredForFile(const base::FilePath& path); | 164 bool IsOpenInBrowserPreferreredForFile(const base::FilePath& path); |
165 | 165 |
166 Profile* profile_; | 166 Profile* profile_; |
167 uint32_t next_download_id_; | 167 uint32_t next_download_id_; |
168 IdCallbackVector id_callbacks_; | 168 IdCallbackVector id_callbacks_; |
169 std::unique_ptr<DownloadPrefs> download_prefs_; | 169 std::unique_ptr<DownloadPrefs> download_prefs_; |
170 | 170 |
171 #if BUILDFLAG(ENABLE_EXTENSIONS) | 171 #if BUILDFLAG(ENABLE_EXTENSIONS) |
172 // Maps from pending extension installations to DownloadItem IDs. | 172 // Maps from pending extension installations to DownloadItem IDs. |
173 typedef base::hash_map<extensions::CrxInstaller*, | 173 typedef base::flat_map<extensions::CrxInstaller*, |
174 content::DownloadOpenDelayedCallback> CrxInstallerMap; | 174 content::DownloadOpenDelayedCallback> |
| 175 CrxInstallerMap; |
175 CrxInstallerMap crx_installers_; | 176 CrxInstallerMap crx_installers_; |
176 #endif | 177 #endif |
177 | 178 |
178 content::NotificationRegistrar registrar_; | 179 content::NotificationRegistrar registrar_; |
179 | 180 |
180 base::WeakPtrFactory<ChromeDownloadManagerDelegate> weak_ptr_factory_; | 181 base::WeakPtrFactory<ChromeDownloadManagerDelegate> weak_ptr_factory_; |
181 | 182 |
182 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); | 183 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate); |
183 }; | 184 }; |
184 | 185 |
185 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ | 186 #endif // CHROME_BROWSER_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |