| 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_item_model.h" | 5 #include "chrome/browser/download/download_item_model.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 break; | 162 break; |
| 163 case content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED: | 163 case content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED: |
| 164 string_id = IDS_DOWNLOAD_STATUS_CANCELLED; | 164 string_id = IDS_DOWNLOAD_STATUS_CANCELLED; |
| 165 break; | 165 break; |
| 166 case content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN: | 166 case content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN: |
| 167 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_SHUTDOWN; | 167 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_SHUTDOWN; |
| 168 break; | 168 break; |
| 169 case content::DOWNLOAD_INTERRUPT_REASON_CRASH: | 169 case content::DOWNLOAD_INTERRUPT_REASON_CRASH: |
| 170 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_CRASH; | 170 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_CRASH; |
| 171 break; | 171 break; |
| 172 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED: |
| 173 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_UNAUTHORIZED; |
| 174 break; |
| 175 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM: |
| 176 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_SERVER_CERT_PROBLEM; |
| 177 break; |
| 172 case content::DOWNLOAD_INTERRUPT_REASON_NONE: | 178 case content::DOWNLOAD_INTERRUPT_REASON_NONE: |
| 173 NOTREACHED(); | 179 NOTREACHED(); |
| 174 // fallthrough | 180 // fallthrough |
| 175 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: | 181 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: |
| 176 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION: | 182 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION: |
| 177 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: | 183 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: |
| 178 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; | 184 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; |
| 179 } | 185 } |
| 180 | 186 |
| 181 return l10n_util::GetStringUTF16(string_id); | 187 return l10n_util::GetStringUTF16(string_id); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 break; | 240 break; |
| 235 case content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED: | 241 case content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED: |
| 236 string_id = IDS_DOWNLOAD_STATUS_CANCELLED; | 242 string_id = IDS_DOWNLOAD_STATUS_CANCELLED; |
| 237 break; | 243 break; |
| 238 case content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN: | 244 case content::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN: |
| 239 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_SHUTDOWN; | 245 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_SHUTDOWN; |
| 240 break; | 246 break; |
| 241 case content::DOWNLOAD_INTERRUPT_REASON_CRASH: | 247 case content::DOWNLOAD_INTERRUPT_REASON_CRASH: |
| 242 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_CRASH; | 248 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_CRASH; |
| 243 break; | 249 break; |
| 250 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED: |
| 251 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_UNAUTHORIZED; |
| 252 break; |
| 253 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_CERT_PROBLEM: |
| 254 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_SERVER_CERT_PROBLEM; |
| 255 break; |
| 244 case content::DOWNLOAD_INTERRUPT_REASON_NONE: | 256 case content::DOWNLOAD_INTERRUPT_REASON_NONE: |
| 245 NOTREACHED(); | 257 NOTREACHED(); |
| 246 // fallthrough | 258 // fallthrough |
| 247 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: | 259 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: |
| 248 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION: | 260 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_PRECONDITION: |
| 249 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: | 261 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: |
| 250 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; | 262 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; |
| 251 } | 263 } |
| 252 | 264 |
| 253 status_text = l10n_util::GetStringUTF16(string_id); | 265 status_text = l10n_util::GetStringUTF16(string_id); |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 if (!download_service) | 695 if (!download_service) |
| 684 return; | 696 return; |
| 685 | 697 |
| 686 ChromeDownloadManagerDelegate* delegate = | 698 ChromeDownloadManagerDelegate* delegate = |
| 687 download_service->GetDownloadManagerDelegate(); | 699 download_service->GetDownloadManagerDelegate(); |
| 688 if (!delegate) | 700 if (!delegate) |
| 689 return; | 701 return; |
| 690 delegate->OpenDownloadUsingPlatformHandler(download_); | 702 delegate->OpenDownloadUsingPlatformHandler(download_); |
| 691 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_USER_PLATFORM); | 703 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_USER_PLATFORM); |
| 692 } | 704 } |
| OLD | NEW |