| OLD | NEW |
| 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/download/download_crx_util.h" | 16 #include "chrome/browser/download/download_crx_util.h" |
| 17 #include "chrome/browser/download/download_extensions.h" | 17 #include "chrome/browser/download/download_extensions.h" |
| 18 #include "chrome/browser/download/download_file_picker.h" | 18 #include "chrome/browser/download/download_file_picker.h" |
| 19 #include "chrome/browser/download/download_history.h" | 19 #include "chrome/browser/download/download_history.h" |
| 20 #include "chrome/browser/download/download_prefs.h" | 20 #include "chrome/browser/download/download_prefs.h" |
| 21 #include "chrome/browser/download/download_util.h" | 21 #include "chrome/browser/download/download_util.h" |
| 22 #include "chrome/browser/download/save_package_file_picker.h" | 22 #include "chrome/browser/download/save_package_file_picker.h" |
| 23 #include "chrome/browser/extensions/crx_installer.h" | 23 #include "chrome/browser/extensions/crx_installer.h" |
| 24 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
| 25 #include "chrome/browser/prefs/pref_member.h" | 25 #include "chrome/browser/prefs/pref_member.h" |
| 26 #include "chrome/browser/prefs/pref_service.h" | 26 #include "chrome/browser/prefs/pref_service.h" |
| 27 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
| 28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 29 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
| 30 #include "chrome/browser/ui/browser_list.h" | 30 #include "chrome/browser/ui/browser_list.h" |
| 31 #include "chrome/common/chrome_notification_types.h" |
| 31 #include "chrome/common/chrome_paths.h" | 32 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/extensions/user_script.h" | 33 #include "chrome/common/extensions/user_script.h" |
| 33 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 34 #include "content/browser/download/download_status_updater.h" | 35 #include "content/browser/download/download_status_updater.h" |
| 35 #include "content/public/browser/download_file.h" | 36 #include "content/public/browser/download_file.h" |
| 36 #include "content/public/browser/download_item.h" | 37 #include "content/public/browser/download_item.h" |
| 37 #include "content/public/browser/download_manager.h" | 38 #include "content/public/browser/download_manager.h" |
| 38 #include "content/public/browser/notification_source.h" | 39 #include "content/public/browser/notification_source.h" |
| 39 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
| 40 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 int32 download_id, int64 db_handle) { | 620 int32 download_id, int64 db_handle) { |
| 620 // It's not immediately obvious, but HistoryBackend::CreateDownload() can | 621 // It's not immediately obvious, but HistoryBackend::CreateDownload() can |
| 621 // call this function with an invalid |db_handle|. For instance, this can | 622 // call this function with an invalid |db_handle|. For instance, this can |
| 622 // happen when the history database is offline. We cannot have multiple | 623 // happen when the history database is offline. We cannot have multiple |
| 623 // DownloadItems with the same invalid db_handle, so we need to assign a | 624 // DownloadItems with the same invalid db_handle, so we need to assign a |
| 624 // unique |db_handle| here. | 625 // unique |db_handle| here. |
| 625 if (db_handle == DownloadItem::kUninitializedHandle) | 626 if (db_handle == DownloadItem::kUninitializedHandle) |
| 626 db_handle = download_history_->GetNextFakeDbHandle(); | 627 db_handle = download_history_->GetNextFakeDbHandle(); |
| 627 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); | 628 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); |
| 628 } | 629 } |
| OLD | NEW |