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

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

Issue 2138323002: Add output_all_resource_defines=false to theme_resources.grd. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: download bits Created 4 years, 5 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/theme/theme_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/download_commands.h" 5 #include "chrome/browser/download/download_commands.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // We don't need to cancel the job, since it shouldn't be started here. 111 // We don't need to cancel the job, since it shouldn't be started here.
112 112
113 task_runner()->DeleteSoon(FROM_HERE, this); 113 task_runner()->DeleteSoon(FROM_HERE, this);
114 } 114 }
115 115
116 const base::FilePath file_path_; 116 const base::FilePath file_path_;
117 117
118 DISALLOW_IMPLICIT_CONSTRUCTORS(ImageClipboardCopyManager); 118 DISALLOW_IMPLICIT_CONSTRUCTORS(ImageClipboardCopyManager);
119 }; 119 };
120 120
121 } // anonymous namespace 121 int GetDownloadNotificationMenuIcon(DownloadCommands::Command command) {
122 #if defined(OS_CHROMEOS)
123 switch (command) {
124 case DownloadCommands::PAUSE:
125 return IDR_DOWNLOAD_NOTIFICATION_MENU_PAUSE;
126 case DownloadCommands::RESUME:
127 return IDR_DOWNLOAD_NOTIFICATION_MENU_DOWNLOAD;
128 case DownloadCommands::SHOW_IN_FOLDER:
129 return IDR_DOWNLOAD_NOTIFICATION_MENU_FOLDER;
130 case DownloadCommands::KEEP:
131 return IDR_DOWNLOAD_NOTIFICATION_MENU_DOWNLOAD;
132 case DownloadCommands::DISCARD:
133 return IDR_DOWNLOAD_NOTIFICATION_MENU_DELETE;
134 case DownloadCommands::CANCEL:
135 return IDR_DOWNLOAD_NOTIFICATION_MENU_CANCEL;
136 case DownloadCommands::COPY_TO_CLIPBOARD:
137 return IDR_DOWNLOAD_NOTIFICATION_MENU_COPY_TO_CLIPBOARD;
138 default:
139 NOTREACHED();
140 return -1;
141 }
142 #else
143 return -1;
144 #endif
145 }
146
147 } // namespace
122 148
123 DownloadCommands::DownloadCommands(content::DownloadItem* download_item) 149 DownloadCommands::DownloadCommands(content::DownloadItem* download_item)
124 : download_item_(download_item) { 150 : download_item_(download_item) {
125 DCHECK(download_item); 151 DCHECK(download_item);
126 } 152 }
127 153
128 int DownloadCommands::GetCommandIconId(Command command) const { 154 int DownloadCommands::GetCommandIconId(Command command) const {
129 switch (command) { 155 switch (command) {
130 case PAUSE: 156 case PAUSE:
131 return IDR_DOWNLOAD_NOTIFICATION_MENU_PAUSE;
132 case RESUME: 157 case RESUME:
133 return IDR_DOWNLOAD_NOTIFICATION_MENU_DOWNLOAD;
134 case SHOW_IN_FOLDER: 158 case SHOW_IN_FOLDER:
135 return IDR_DOWNLOAD_NOTIFICATION_MENU_FOLDER;
136 case KEEP: 159 case KEEP:
137 return IDR_DOWNLOAD_NOTIFICATION_MENU_DOWNLOAD;
138 case DISCARD: 160 case DISCARD:
139 return IDR_DOWNLOAD_NOTIFICATION_MENU_DELETE;
140 case CANCEL: 161 case CANCEL:
141 return IDR_DOWNLOAD_NOTIFICATION_MENU_CANCEL; 162 case COPY_TO_CLIPBOARD:
163 return GetDownloadNotificationMenuIcon(command);
142 case LEARN_MORE_SCANNING: 164 case LEARN_MORE_SCANNING:
143 return IDR_NOTIFICATION_WELCOME_LEARN_MORE; 165 return IDR_NOTIFICATION_WELCOME_LEARN_MORE;
144 case COPY_TO_CLIPBOARD:
145 return IDR_DOWNLOAD_NOTIFICATION_MENU_COPY_TO_CLIPBOARD;
146 case OPEN_WHEN_COMPLETE: 166 case OPEN_WHEN_COMPLETE:
147 case ALWAYS_OPEN_TYPE: 167 case ALWAYS_OPEN_TYPE:
148 case PLATFORM_OPEN: 168 case PLATFORM_OPEN:
149 case LEARN_MORE_INTERRUPTED: 169 case LEARN_MORE_INTERRUPTED:
150 return -1; 170 return -1;
151 } 171 }
152 NOTREACHED(); 172 NOTREACHED();
153 return -1; 173 return -1;
154 } 174 }
155 175
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 &mime) || 417 &mime) ||
398 !mime_util::IsSupportedImageMimeType(mime)) { 418 !mime_util::IsSupportedImageMimeType(mime)) {
399 // It seems a non-image file. 419 // It seems a non-image file.
400 return; 420 return;
401 } 421 }
402 } 422 }
403 423
404 base::FilePath file_path = download_item_->GetFullPath(); 424 base::FilePath file_path = download_item_->GetFullPath();
405 ImageClipboardCopyManager::Start(file_path); 425 ImageClipboardCopyManager::Start(file_path);
406 } 426 }
OLDNEW
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698