| 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 "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/download/download_crx_util.h" | 10 #include "chrome/browser/download/download_crx_util.h" |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 } | 686 } |
| 687 return title_text; | 687 return title_text; |
| 688 } | 688 } |
| 689 | 689 |
| 690 base::string16 DownloadItemNotification::GetCommandLabel( | 690 base::string16 DownloadItemNotification::GetCommandLabel( |
| 691 DownloadCommands::Command command) const { | 691 DownloadCommands::Command command) const { |
| 692 int id = -1; | 692 int id = -1; |
| 693 switch (command) { | 693 switch (command) { |
| 694 case DownloadCommands::OPEN_WHEN_COMPLETE: | 694 case DownloadCommands::OPEN_WHEN_COMPLETE: |
| 695 if (item_ && !item_->IsDone()) | 695 if (item_ && !item_->IsDone()) |
| 696 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; | 696 id = IDS_DOWNLOAD_NOTIFICATION_LABEL_OPEN_WHEN_COMPLETE; |
| 697 else | 697 else |
| 698 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; | 698 id = IDS_DOWNLOAD_NOTIFICATION_LABEL_OPEN; |
| 699 break; | 699 break; |
| 700 case DownloadCommands::PAUSE: | 700 case DownloadCommands::PAUSE: |
| 701 // Only for non menu. | 701 // Only for non menu. |
| 702 id = IDS_DOWNLOAD_LINK_PAUSE; | 702 id = IDS_DOWNLOAD_LINK_PAUSE; |
| 703 break; | 703 break; |
| 704 case DownloadCommands::RESUME: | 704 case DownloadCommands::RESUME: |
| 705 // Only for non menu. | 705 // Only for non menu. |
| 706 id = IDS_DOWNLOAD_LINK_RESUME; | 706 id = IDS_DOWNLOAD_LINK_RESUME; |
| 707 break; | 707 break; |
| 708 case DownloadCommands::SHOW_IN_FOLDER: | 708 case DownloadCommands::SHOW_IN_FOLDER: |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 profile_id); | 899 profile_id); |
| 900 | 900 |
| 901 message_center::NotificationList::Notifications visible_notifications = | 901 message_center::NotificationList::Notifications visible_notifications = |
| 902 g_browser_process->message_center()->GetVisibleNotifications(); | 902 g_browser_process->message_center()->GetVisibleNotifications(); |
| 903 for (const auto& notification : visible_notifications) { | 903 for (const auto& notification : visible_notifications) { |
| 904 if (notification->id() == notification_id_in_message_center) | 904 if (notification->id() == notification_id_in_message_center) |
| 905 return true; | 905 return true; |
| 906 } | 906 } |
| 907 return false; | 907 return false; |
| 908 } | 908 } |
| OLD | NEW |