OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |