OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 5 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "chrome/browser/download/download_extensions.h" | 12 #include "chrome/browser/download/download_extensions.h" |
13 #include "chrome/browser/download/download_file_picker.h" | 13 #include "chrome/browser/download/download_file_picker.h" |
14 #include "chrome/browser/download/download_history.h" | 14 #include "chrome/browser/download/download_history.h" |
15 #include "chrome/browser/download/download_item.h" | |
16 #include "chrome/browser/download/download_manager.h" | |
17 #include "chrome/browser/download/download_prefs.h" | 15 #include "chrome/browser/download/download_prefs.h" |
18 #include "chrome/browser/download/download_safe_browsing_client.h" | 16 #include "chrome/browser/download/download_safe_browsing_client.h" |
19 #include "chrome/browser/download/download_util.h" | 17 #include "chrome/browser/download/download_util.h" |
20 #include "chrome/browser/download/save_package_file_picker.h" | 18 #include "chrome/browser/download/save_package_file_picker.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/prefs/pref_member.h" | 20 #include "chrome/browser/prefs/pref_member.h" |
23 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
24 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
26 #include "chrome/browser/ui/browser_list.h" | 24 #include "chrome/browser/ui/browser_list.h" |
27 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
28 #include "chrome/common/extensions/user_script.h" | 26 #include "chrome/common/extensions/user_script.h" |
29 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "content/browser/download/download_item.h" |
| 29 #include "content/browser/download/download_manager.h" |
30 #include "content/browser/tab_contents/tab_contents.h" | 30 #include "content/browser/tab_contents/tab_contents.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
33 | 33 |
34 ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate() { | 34 ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate() { |
35 } | 35 } |
36 | 36 |
37 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { | 37 ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { |
38 } | 38 } |
39 | 39 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 if (state.is_extension_install) { | 352 if (state.is_extension_install) { |
353 // Extensions that are not from the gallery are considered dangerous. | 353 // Extensions that are not from the gallery are considered dangerous. |
354 ExtensionService* service = | 354 ExtensionService* service = |
355 download_manager_->profile()->GetExtensionService(); | 355 download_manager_->profile()->GetExtensionService(); |
356 if (!service || !service->IsDownloadFromGallery(download.GetURL(), | 356 if (!service || !service->IsDownloadFromGallery(download.GetURL(), |
357 download.referrer_url())) | 357 download.referrer_url())) |
358 return true; | 358 return true; |
359 } | 359 } |
360 return false; | 360 return false; |
361 } | 361 } |
OLD | NEW |