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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if ((item->GetWebContents() && !item->GetWebContents()->GetDelegate()) && | 399 if ((item->GetWebContents() && !item->GetWebContents()->GetDelegate()) && |
400 !web_intents::GetBrowserForBackgroundWebIntentDelivery(profile_)) { | 400 !web_intents::GetBrowserForBackgroundWebIntentDelivery(profile_)) { |
401 return false; | 401 return false; |
402 } | 402 } |
403 if (!item->GetForcedFilePath().empty()) | 403 if (!item->GetForcedFilePath().empty()) |
404 return false; | 404 return false; |
405 if (item->GetTargetDisposition() == DownloadItem::TARGET_DISPOSITION_PROMPT) | 405 if (item->GetTargetDisposition() == DownloadItem::TARGET_DISPOSITION_PROMPT) |
406 return false; | 406 return false; |
407 | 407 |
408 std::string mime_type = item->GetMimeType(); | 408 std::string mime_type = item->GetMimeType(); |
409 if (mime_type == "application/rss+xml" || | |
410 mime_type == "application/atom+xml") { | |
411 return true; | |
412 } | |
413 | 409 |
414 #if defined(OS_CHROMEOS) | 410 #if defined(OS_CHROMEOS) |
415 if (mime_type == "application/msword" || | 411 if (mime_type == "application/msword" || |
416 mime_type == "application/vnd.ms-powerpoint" || | 412 mime_type == "application/vnd.ms-powerpoint" || |
417 mime_type == "application/vnd.ms-excel" || | 413 mime_type == "application/vnd.ms-excel" || |
418 mime_type == "application/vnd.openxmlformats-officedocument." | 414 mime_type == "application/vnd.openxmlformats-officedocument." |
419 "wordprocessingml.document" || | 415 "wordprocessingml.document" || |
420 mime_type == "application/vnd.openxmlformats-officedocument." | 416 mime_type == "application/vnd.openxmlformats-officedocument." |
421 "presentationml.presentation" || | 417 "presentationml.presentation" || |
422 mime_type == "application/vnd.openxmlformats-officedocument." | 418 mime_type == "application/vnd.openxmlformats-officedocument." |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 int32 download_id, int64 db_handle) { | 900 int32 download_id, int64 db_handle) { |
905 // It's not immediately obvious, but HistoryBackend::CreateDownload() can | 901 // It's not immediately obvious, but HistoryBackend::CreateDownload() can |
906 // call this function with an invalid |db_handle|. For instance, this can | 902 // call this function with an invalid |db_handle|. For instance, this can |
907 // happen when the history database is offline. We cannot have multiple | 903 // happen when the history database is offline. We cannot have multiple |
908 // DownloadItems with the same invalid db_handle, so we need to assign a | 904 // DownloadItems with the same invalid db_handle, so we need to assign a |
909 // unique |db_handle| here. | 905 // unique |db_handle| here. |
910 if (db_handle == DownloadItem::kUninitializedHandle) | 906 if (db_handle == DownloadItem::kUninitializedHandle) |
911 db_handle = download_history_->GetNextFakeDbHandle(); | 907 db_handle = download_history_->GetNextFakeDbHandle(); |
912 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); | 908 download_manager_->OnItemAddedToPersistentStore(download_id, db_handle); |
913 } | 909 } |
OLD | NEW |