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/extensions/api/downloads/downloads_api.h" | 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cctype> | 8 #include <cctype> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <set> | 10 #include <set> |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 // DownloadDangerPrompt deletes itself | 1064 // DownloadDangerPrompt deletes itself |
1065 return true; | 1065 return true; |
1066 } | 1066 } |
1067 | 1067 |
1068 void DownloadsAcceptDangerFunction::DangerPromptCallback( | 1068 void DownloadsAcceptDangerFunction::DangerPromptCallback( |
1069 bool accept, int download_id) { | 1069 bool accept, int download_id) { |
1070 if (accept) { | 1070 if (accept) { |
1071 DownloadItem* download_item = GetDownloadIfInProgress( | 1071 DownloadItem* download_item = GetDownloadIfInProgress( |
1072 profile(), include_incognito(), download_id); | 1072 profile(), include_incognito(), download_id); |
1073 if (download_item) | 1073 if (download_item) |
1074 download_item->DangerousDownloadValidated(); | 1074 download_item->ValidateDangerousDownload(); |
1075 } | 1075 } |
1076 SendResponse(error_.empty()); | 1076 SendResponse(error_.empty()); |
1077 } | 1077 } |
1078 | 1078 |
1079 DownloadsShowFunction::DownloadsShowFunction() {} | 1079 DownloadsShowFunction::DownloadsShowFunction() {} |
1080 | 1080 |
1081 DownloadsShowFunction::~DownloadsShowFunction() {} | 1081 DownloadsShowFunction::~DownloadsShowFunction() {} |
1082 | 1082 |
1083 bool DownloadsShowFunction::RunImpl() { | 1083 bool DownloadsShowFunction::RunImpl() { |
1084 scoped_ptr<extensions::api::downloads::Show::Params> params( | 1084 scoped_ptr<extensions::api::downloads::Show::Params> params( |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 DownloadsNotificationSource notification_source; | 1498 DownloadsNotificationSource notification_source; |
1499 notification_source.event_name = event_name; | 1499 notification_source.event_name = event_name; |
1500 notification_source.profile = profile_; | 1500 notification_source.profile = profile_; |
1501 content::Source<DownloadsNotificationSource> content_source( | 1501 content::Source<DownloadsNotificationSource> content_source( |
1502 ¬ification_source); | 1502 ¬ification_source); |
1503 content::NotificationService::current()->Notify( | 1503 content::NotificationService::current()->Notify( |
1504 chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, | 1504 chrome::NOTIFICATION_EXTENSION_DOWNLOADS_EVENT, |
1505 content_source, | 1505 content_source, |
1506 content::Details<std::string>(&json_args)); | 1506 content::Details<std::string>(&json_args)); |
1507 } | 1507 } |
OLD | NEW |