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

Side by Side Diff: chrome/browser/download/notification/download_notification_item.cc

Issue 1105953002: Pop up the notification when the download is interrupted or completed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dn-xxxx-close-bug
Patch Set: . Created 5 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/notification/download_notification_item.h" 5 #include "chrome/browser/download/notification/download_notification_item.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/download/download_crx_util.h" 9 #include "chrome/browser/download/download_crx_util.h"
10 #include "chrome/browser/download/download_item_model.h" 10 #include "chrome/browser/download/download_item_model.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 notification_->set_type(message_center::NOTIFICATION_TYPE_PROGRESS); 179 notification_->set_type(message_center::NOTIFICATION_TYPE_PROGRESS);
180 notification_->set_progress(item_->PercentComplete()); 180 notification_->set_progress(item_->PercentComplete());
181 if (is_off_the_record) { 181 if (is_off_the_record) {
182 // TODO(yoshiki): Replace the tentative image. 182 // TODO(yoshiki): Replace the tentative image.
183 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_INCOGNITO); 183 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_INCOGNITO);
184 } else { 184 } else {
185 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING); 185 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING);
186 } 186 }
187 break; 187 break;
188 case content::DownloadItem::COMPLETE: 188 case content::DownloadItem::COMPLETE:
189 notification_->set_type(message_center::NOTIFICATION_TYPE_SIMPLE); 189 notification_->set_type(message_center::NOTIFICATION_TYPE_PROGRESS);
190 notification_->set_progress(100);
asanka 2015/04/28 22:36:40 Isn't the progress and type already correct at thi
yoshiki 2015/05/12 14:49:33 No. As for progress, before here, the progress, wh
190 if (is_off_the_record) { 191 if (is_off_the_record) {
191 // TODO(yoshiki): Replace the tentative image. 192 // TODO(yoshiki): Replace the tentative image.
192 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_INCOGNITO); 193 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_INCOGNITO);
193 } else { 194 } else {
194 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING); 195 SetNotificationImage(IDR_DOWNLOAD_NOTIFICATION_DOWNLOADING);
195 } 196 }
196 197
197 // TODO(yoshiki): Popup a notification again. 198 // TODO(yoshiki): Popup a notification again.
198 break; 199 break;
199 case content::DownloadItem::CANCELLED: 200 case content::DownloadItem::CANCELLED:
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS: 413 case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS:
413 case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT: 414 case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT:
414 case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED: 415 case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED:
415 case content::DOWNLOAD_DANGER_TYPE_MAX: { 416 case content::DOWNLOAD_DANGER_TYPE_MAX: {
416 break; 417 break;
417 } 418 }
418 } 419 }
419 NOTREACHED(); 420 NOTREACHED();
420 return base::string16(); 421 return base::string16();
421 } 422 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698