| 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/download_danger_prompt.h" | 5 #include "chrome/browser/download/download_danger_prompt.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 8 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 9 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" | 9 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 10 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" | 10 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 if (!show_context_) | 111 if (!show_context_) |
| 112 return l10n_util::GetStringUTF16( | 112 return l10n_util::GetStringUTF16( |
| 113 IDS_PROMPT_CONFIRM_KEEP_DANGEROUS_DOWNLOAD); | 113 IDS_PROMPT_CONFIRM_KEEP_DANGEROUS_DOWNLOAD); |
| 114 switch (download_->GetDangerType()) { | 114 switch (download_->GetDangerType()) { |
| 115 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: | 115 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE: |
| 116 return l10n_util::GetStringFUTF16( | 116 return l10n_util::GetStringFUTF16( |
| 117 IDS_PROMPT_DANGEROUS_DOWNLOAD, | 117 IDS_PROMPT_DANGEROUS_DOWNLOAD, |
| 118 download_->GetFileNameToReportUser().LossyDisplayName()); | 118 download_->GetFileNameToReportUser().LossyDisplayName()); |
| 119 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL: // Fall through | 119 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL: // Fall through |
| 120 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT: | 120 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT: |
| 121 case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: |
| 121 return l10n_util::GetStringFUTF16( | 122 return l10n_util::GetStringFUTF16( |
| 122 IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT, | 123 IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT, |
| 123 download_->GetFileNameToReportUser().LossyDisplayName()); | 124 download_->GetFileNameToReportUser().LossyDisplayName()); |
| 124 case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: | 125 case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: |
| 125 return l10n_util::GetStringFUTF16( | 126 return l10n_util::GetStringFUTF16( |
| 126 IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT, | 127 IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT, |
| 127 download_->GetFileNameToReportUser().LossyDisplayName()); | 128 download_->GetFileNameToReportUser().LossyDisplayName()); |
| 128 default: | 129 default: |
| 129 NOTREACHED(); | 130 NOTREACHED(); |
| 130 return string16(); | 131 return string16(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 content::WebContents* web_contents, | 172 content::WebContents* web_contents, |
| 172 bool show_context, | 173 bool show_context, |
| 173 const base::Closure& accepted, | 174 const base::Closure& accepted, |
| 174 const base::Closure& canceled) { | 175 const base::Closure& canceled) { |
| 175 DownloadDangerPromptImpl* prompt = new DownloadDangerPromptImpl( | 176 DownloadDangerPromptImpl* prompt = new DownloadDangerPromptImpl( |
| 176 item, web_contents, show_context, accepted, canceled); | 177 item, web_contents, show_context, accepted, canceled); |
| 177 // |prompt| will be deleted when the dialog is done. | 178 // |prompt| will be deleted when the dialog is done. |
| 178 TabModalConfirmDialog::Create(prompt, web_contents); | 179 TabModalConfirmDialog::Create(prompt, web_contents); |
| 179 return prompt; | 180 return prompt; |
| 180 } | 181 } |
| OLD | NEW |