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_item_notification.h" | 5 #include "chrome/browser/download/notification/download_item_notification.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 content::RecordAction( | 245 content::RecordAction( |
246 UserMetricsAction("DownloadNotification.Click_InProgress")); | 246 UserMetricsAction("DownloadNotification.Click_InProgress")); |
247 item_->SetOpenWhenComplete(!item_->GetOpenWhenComplete()); // Toggle | 247 item_->SetOpenWhenComplete(!item_->GetOpenWhenComplete()); // Toggle |
248 break; | 248 break; |
249 case content::DownloadItem::CANCELLED: | 249 case content::DownloadItem::CANCELLED: |
250 case content::DownloadItem::INTERRUPTED: | 250 case content::DownloadItem::INTERRUPTED: |
251 content::RecordAction( | 251 content::RecordAction( |
252 UserMetricsAction("DownloadNotification.Click_Stopped")); | 252 UserMetricsAction("DownloadNotification.Click_Stopped")); |
253 GetBrowser()->OpenURL(content::OpenURLParams( | 253 GetBrowser()->OpenURL(content::OpenURLParams( |
254 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), | 254 GURL(chrome::kChromeUIDownloadsURL), content::Referrer(), |
255 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 255 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
256 false /* is_renderer_initiated */)); | 256 false /* is_renderer_initiated */)); |
257 CloseNotificationByUser(); | 257 CloseNotificationByUser(); |
258 break; | 258 break; |
259 case content::DownloadItem::COMPLETE: | 259 case content::DownloadItem::COMPLETE: |
260 content::RecordAction( | 260 content::RecordAction( |
261 UserMetricsAction("DownloadNotification.Click_Completed")); | 261 UserMetricsAction("DownloadNotification.Click_Completed")); |
262 item_->OpenDownload(); | 262 item_->OpenDownload(); |
263 CloseNotificationByUser(); | 263 CloseNotificationByUser(); |
264 break; | 264 break; |
265 case content::DownloadItem::MAX_DOWNLOAD_STATE: | 265 case content::DownloadItem::MAX_DOWNLOAD_STATE: |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 const std::string notification_id_in_message_center = notification->id(); | 935 const std::string notification_id_in_message_center = notification->id(); |
936 | 936 |
937 message_center::NotificationList::Notifications visible_notifications = | 937 message_center::NotificationList::Notifications visible_notifications = |
938 message_center_->GetVisibleNotifications(); | 938 message_center_->GetVisibleNotifications(); |
939 for (auto* notification : visible_notifications) { | 939 for (auto* notification : visible_notifications) { |
940 if (notification->id() == notification_id_in_message_center) | 940 if (notification->id() == notification_id_in_message_center) |
941 return true; | 941 return true; |
942 } | 942 } |
943 return false; | 943 return false; |
944 } | 944 } |
OLD | NEW |