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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 } | 677 } |
678 return title_text; | 678 return title_text; |
679 } | 679 } |
680 | 680 |
681 base::string16 DownloadItemNotification::GetCommandLabel( | 681 base::string16 DownloadItemNotification::GetCommandLabel( |
682 DownloadCommands::Command command) const { | 682 DownloadCommands::Command command) const { |
683 int id = -1; | 683 int id = -1; |
684 switch (command) { | 684 switch (command) { |
685 case DownloadCommands::OPEN_WHEN_COMPLETE: | 685 case DownloadCommands::OPEN_WHEN_COMPLETE: |
686 if (item_ && !item_->IsDone()) | 686 if (item_ && !item_->IsDone()) |
687 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; | 687 id = IDS_DOWNLOAD_NOTIFICATION_LABEL_OPEN_WHEN_COMPLETE; |
688 else | 688 else |
689 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; | 689 id = IDS_DOWNLOAD_NOTIFICATION_LABEL_OPEN; |
690 break; | 690 break; |
691 case DownloadCommands::PAUSE: | 691 case DownloadCommands::PAUSE: |
692 // Only for non menu. | 692 // Only for non menu. |
693 id = IDS_DOWNLOAD_LINK_PAUSE; | 693 id = IDS_DOWNLOAD_LINK_PAUSE; |
694 break; | 694 break; |
695 case DownloadCommands::RESUME: | 695 case DownloadCommands::RESUME: |
696 // Only for non menu. | 696 // Only for non menu. |
697 id = IDS_DOWNLOAD_LINK_RESUME; | 697 id = IDS_DOWNLOAD_LINK_RESUME; |
698 break; | 698 break; |
699 case DownloadCommands::SHOW_IN_FOLDER: | 699 case DownloadCommands::SHOW_IN_FOLDER: |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 profile_id); | 890 profile_id); |
891 | 891 |
892 message_center::NotificationList::Notifications visible_notifications = | 892 message_center::NotificationList::Notifications visible_notifications = |
893 g_browser_process->message_center()->GetVisibleNotifications(); | 893 g_browser_process->message_center()->GetVisibleNotifications(); |
894 for (const auto& notification : visible_notifications) { | 894 for (const auto& notification : visible_notifications) { |
895 if (notification->id() == notification_id_in_message_center) | 895 if (notification->id() == notification_id_in_message_center) |
896 return true; | 896 return true; |
897 } | 897 } |
898 return false; | 898 return false; |
899 } | 899 } |
OLD | NEW |