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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 } | 675 } |
676 | 676 |
677 base::string16 DownloadItemNotification::GetCommandLabel( | 677 base::string16 DownloadItemNotification::GetCommandLabel( |
678 DownloadCommands::Command command) const { | 678 DownloadCommands::Command command) const { |
679 int id = -1; | 679 int id = -1; |
680 switch (command) { | 680 switch (command) { |
681 case DownloadCommands::OPEN_WHEN_COMPLETE: | 681 case DownloadCommands::OPEN_WHEN_COMPLETE: |
682 if (item_ && !item_->IsDone()) | 682 if (item_ && !item_->IsDone()) |
683 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; | 683 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; |
684 else | 684 else |
685 id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE; | 685 id = IDS_DOWNLOAD_STATUS_OPEN; |
asanka
2015/09/25 03:18:47
yoshiki: Aren't these labels for the command butto
Deepak
2015/09/25 16:09:33
In DownloadShelfContextMenu::GetLabelForCommandId(
asanka
2015/09/25 17:09:35
_DOWNLOAD_STATUS_ is for download status strings.
Deepak
2015/09/27 06:19:57
I got your point. Changes done.
Thanks
| |
686 break; | 686 break; |
687 case DownloadCommands::PAUSE: | 687 case DownloadCommands::PAUSE: |
688 // Only for non menu. | 688 // Only for non menu. |
689 id = IDS_DOWNLOAD_LINK_PAUSE; | 689 id = IDS_DOWNLOAD_LINK_PAUSE; |
690 break; | 690 break; |
691 case DownloadCommands::RESUME: | 691 case DownloadCommands::RESUME: |
692 // Only for non menu. | 692 // Only for non menu. |
693 id = IDS_DOWNLOAD_LINK_RESUME; | 693 id = IDS_DOWNLOAD_LINK_RESUME; |
694 break; | 694 break; |
695 case DownloadCommands::SHOW_IN_FOLDER: | 695 case DownloadCommands::SHOW_IN_FOLDER: |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 profile_id); | 886 profile_id); |
887 | 887 |
888 message_center::NotificationList::Notifications visible_notifications = | 888 message_center::NotificationList::Notifications visible_notifications = |
889 g_browser_process->message_center()->GetVisibleNotifications(); | 889 g_browser_process->message_center()->GetVisibleNotifications(); |
890 for (const auto& notification : visible_notifications) { | 890 for (const auto& notification : visible_notifications) { |
891 if (notification->id() == notification_id_in_message_center) | 891 if (notification->id() == notification_id_in_message_center) |
892 return true; | 892 return true; |
893 } | 893 } |
894 return false; | 894 return false; |
895 } | 895 } |
OLD | NEW |