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 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 5 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "chrome/browser/ui/browser_finder.h" | 42 #include "chrome/browser/ui/browser_finder.h" |
43 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 43 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
44 #include "chrome/common/chrome_constants.h" | 44 #include "chrome/common/chrome_constants.h" |
45 #include "chrome/common/pref_names.h" | 45 #include "chrome/common/pref_names.h" |
46 #include "components/user_prefs/pref_registry_syncable.h" | 46 #include "components/user_prefs/pref_registry_syncable.h" |
47 #include "content/public/browser/download_item.h" | 47 #include "content/public/browser/download_item.h" |
48 #include "content/public/browser/download_manager.h" | 48 #include "content/public/browser/download_manager.h" |
49 #include "content/public/browser/notification_source.h" | 49 #include "content/public/browser/notification_source.h" |
50 #include "content/public/browser/page_navigator.h" | 50 #include "content/public/browser/page_navigator.h" |
51 #include "extensions/common/constants.h" | 51 #include "extensions/common/constants.h" |
| 52 #include "net/base/filename_util.h" |
52 #include "net/base/mime_util.h" | 53 #include "net/base/mime_util.h" |
53 #include "net/base/net_util.h" | |
54 | 54 |
55 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
56 #include "chrome/browser/chromeos/drive/download_handler.h" | 56 #include "chrome/browser/chromeos/drive/download_handler.h" |
57 #include "chrome/browser/chromeos/drive/file_system_util.h" | 57 #include "chrome/browser/chromeos/drive/file_system_util.h" |
58 #endif | 58 #endif |
59 | 59 |
60 using content::BrowserThread; | 60 using content::BrowserThread; |
61 using content::DownloadItem; | 61 using content::DownloadItem; |
62 using content::DownloadManager; | 62 using content::DownloadManager; |
63 using safe_browsing::DownloadProtectionService; | 63 using safe_browsing::DownloadProtectionService; |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 DownloadItem* item = download_manager_->GetDownload(download_id); | 704 DownloadItem* item = download_manager_->GetDownload(download_id); |
705 if (!target_info->target_path.empty() && item && | 705 if (!target_info->target_path.empty() && item && |
706 IsOpenInBrowserPreferreredForFile(target_info->target_path) && | 706 IsOpenInBrowserPreferreredForFile(target_info->target_path) && |
707 target_info->is_filetype_handled_safely) | 707 target_info->is_filetype_handled_safely) |
708 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); | 708 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); |
709 callback.Run(target_info->target_path, | 709 callback.Run(target_info->target_path, |
710 target_info->target_disposition, | 710 target_info->target_disposition, |
711 target_info->danger_type, | 711 target_info->danger_type, |
712 target_info->intermediate_path); | 712 target_info->intermediate_path); |
713 } | 713 } |
OLD | NEW |