Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: chrome/browser/download/notification/download_item_notification.cc

Issue 1368653002: Setting CommandLabel 'IDS_DOWNLOAD_NOTIFICATION_LABEL_OPEN" for finished Download Notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698