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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 item_->OnNotificationButtonClick(button_index); | 64 item_->OnNotificationButtonClick(button_index); |
65 } | 65 } |
66 | 66 |
67 std::string DownloadNotificationItem::NotificationWatcher::id() const { | 67 std::string DownloadNotificationItem::NotificationWatcher::id() const { |
68 return base::UintToString(item_->item_->GetId()); | 68 return base::UintToString(item_->item_->GetId()); |
69 } | 69 } |
70 | 70 |
71 DownloadNotificationItem::DownloadNotificationItem(content::DownloadItem* item, | 71 DownloadNotificationItem::DownloadNotificationItem(content::DownloadItem* item, |
72 Profile* profile, | 72 Profile* profile, |
73 Delegate* delegate) | 73 Delegate* delegate) |
74 : openable_(false), | 74 : profile_(profile), |
75 downloading_(false), | |
76 image_resource_id_(0), | |
77 profile_(profile), | |
78 watcher_(new NotificationWatcher(this)), | 75 watcher_(new NotificationWatcher(this)), |
79 item_(item), | 76 item_(item), |
80 delegate_(delegate) { | 77 delegate_(delegate) { |
81 item->AddObserver(this); | 78 item->AddObserver(this); |
82 | 79 |
83 // Notify that the instance is just created. | 80 // Notify that the instance is just created. |
84 delegate_->OnCreated(this); | 81 delegate_->OnCreated(this); |
85 | 82 |
86 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 83 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
87 | 84 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS: | 445 case content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS: |
449 case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT: | 446 case content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT: |
450 case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED: | 447 case content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED: |
451 case content::DOWNLOAD_DANGER_TYPE_MAX: { | 448 case content::DOWNLOAD_DANGER_TYPE_MAX: { |
452 break; | 449 break; |
453 } | 450 } |
454 } | 451 } |
455 NOTREACHED(); | 452 NOTREACHED(); |
456 return base::string16(); | 453 return base::string16(); |
457 } | 454 } |
OLD | NEW |