Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: chrome/browser/download/download_item_model.cc

Issue 2528483003: [Android Downloads] Long-press menu item "Download Link" should delegate job to OfflinePages backen… (Closed)
Patch Set: removed unnecessary #include Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE: 177 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE:
178 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_UNREACHABLE; 178 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS_UNREACHABLE;
179 break; 179 break;
180 180
181 case content::DOWNLOAD_INTERRUPT_REASON_NONE: 181 case content::DOWNLOAD_INTERRUPT_REASON_NONE:
182 NOTREACHED(); 182 NOTREACHED();
183 // fallthrough 183 // fallthrough
184 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: 184 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE:
185 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: 185 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED:
186 case content::DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH: 186 case content::DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH:
187 case content::DOWNLOAD_INTERRUPT_REASON_PAGE_DOWNLOAD_HANDOFF:
187 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; 188 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS;
188 } 189 }
189 190
190 return l10n_util::GetStringUTF16(string_id); 191 return l10n_util::GetStringUTF16(string_id);
191 } 192 }
192 193
193 base::string16 InterruptReasonMessage(content::DownloadInterruptReason reason) { 194 base::string16 InterruptReasonMessage(content::DownloadInterruptReason reason) {
194 int string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; 195 int string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS;
195 base::string16 status_text; 196 base::string16 status_text;
196 197
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 break; 262 break;
262 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE: 263 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE:
263 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_UNREACHABLE; 264 string_id = IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_UNREACHABLE;
264 break; 265 break;
265 case content::DOWNLOAD_INTERRUPT_REASON_NONE: 266 case content::DOWNLOAD_INTERRUPT_REASON_NONE:
266 NOTREACHED(); 267 NOTREACHED();
267 // fallthrough 268 // fallthrough
268 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE: 269 case content::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE:
269 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED: 270 case content::DOWNLOAD_INTERRUPT_REASON_FILE_FAILED:
270 case content::DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH: 271 case content::DOWNLOAD_INTERRUPT_REASON_FILE_HASH_MISMATCH:
272 case content::DOWNLOAD_INTERRUPT_REASON_PAGE_DOWNLOAD_HANDOFF:
271 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS; 273 string_id = IDS_DOWNLOAD_INTERRUPTED_STATUS;
272 } 274 }
273 275
274 status_text = l10n_util::GetStringUTF16(string_id); 276 status_text = l10n_util::GetStringUTF16(string_id);
275 277
276 return status_text; 278 return status_text;
277 } 279 }
278 280
279 } // namespace 281 } // namespace
280 282
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 if (!download_service) 744 if (!download_service)
743 return; 745 return;
744 746
745 ChromeDownloadManagerDelegate* delegate = 747 ChromeDownloadManagerDelegate* delegate =
746 download_service->GetDownloadManagerDelegate(); 748 download_service->GetDownloadManagerDelegate();
747 if (!delegate) 749 if (!delegate)
748 return; 750 return;
749 delegate->OpenDownloadUsingPlatformHandler(download_); 751 delegate->OpenDownloadUsingPlatformHandler(download_);
750 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_USER_PLATFORM); 752 RecordDownloadOpenMethod(DOWNLOAD_OPEN_METHOD_USER_PLATFORM);
751 } 753 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698