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

Side by Side Diff: chrome/browser/download/download_commands.cc

Issue 852043002: Initial Implementation of Download Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 10 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/download/download_commands.h"
6 #include "chrome/grit/generated_resources.h"
7 #include "grit/theme_resources.h"
8 #include "ui/base/l10n/l10n_util.h"
9
10 base::string16 GetCommandText(DownloadCommands type) {
11 int string_id;
12 switch (type) {
13 case OPEN_WHEN_COMPLETE:
14 string_id = IDS_DOWNLOAD_STATUS_OPEN_WHEN_COMPLETE;
15 break;
16 case PAUSE:
17 string_id = IDS_DOWNLOAD_LINK_PAUSE;
18 break;
19 case RESUME:
20 string_id = IDS_DOWNLOAD_LINK_RESUME;
21 break;
22 case SHOW_IN_FOLDER:
23 string_id = IDS_DOWNLOAD_LINK_SHOW;
24 break;
25 case RETRY:
26 string_id = IDS_DOWNLOAD_LINK_RETRY;
27 break;
28 case DISCARD:
29 string_id = IDS_DISCARD_DOWNLOAD;
30 break;
31 default:
asanka 2015/01/31 00:38:51 Don't use a 'default' clause. The compiler will wa
32 // TODO
33 return base::string16();
34 }
35 return l10n_util::GetStringUTF16(string_id);
36 }
37
38 int GetCommandIconId(DownloadCommands type) {
39 switch (type) {
40 case OPEN_WHEN_COMPLETE:
41 return -1;
42 case PAUSE:
43 return IDR_DOWNLOAD_NOTIFICATION_MENU_PAUSE;
44 case RESUME:
45 return IDR_DOWNLOAD_NOTIFICATION_MENU_RESUME;
46 case SHOW_IN_FOLDER:
47 return IDR_DOWNLOAD_NOTIFICATION_MENU_FOLDER;
48 case RETRY:
49 return IDR_DOWNLOAD_NOTIFICATION_MENU_DOWNLOAD;
50 case DISCARD:
51 return IDR_DOWNLOAD_NOTIFICATION_MENU_DELETE;
52 default:
asanka 2015/01/31 00:38:51 Ditto.
53 return -1;
54 }
55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698