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

Side by Side Diff: chrome/browser/chromeos/printing/cups_print_job_notification.cc

Issue 2958653002: Fix string for single page print jobs. (Closed)
Patch Set: fix base Created 3 years, 6 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/chromeos_strings.grdp ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/printing/cups_print_job_notification.h" 5 #include "chrome/browser/chromeos/printing/cups_print_job_notification.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 case CupsPrintJob::State::STATE_CANCELLED: 227 case CupsPrintJob::State::STATE_CANCELLED:
228 case CupsPrintJob::State::STATE_ERROR: 228 case CupsPrintJob::State::STATE_ERROR:
229 notification_->set_icon( 229 notification_->set_icon(
230 bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_ERROR)); 230 bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_ERROR));
231 case CupsPrintJob::State::STATE_NONE: 231 case CupsPrintJob::State::STATE_NONE:
232 break; 232 break;
233 } 233 }
234 } 234 }
235 235
236 void CupsPrintJobNotification::UpdateNotificationBodyMessage() { 236 void CupsPrintJobNotification::UpdateNotificationBodyMessage() {
237 base::string16 message = l10n_util::GetStringFUTF16( 237 base::string16 message;
238 (print_job_->total_page_number() > 1) 238 if (print_job_->total_page_number() > 1) {
239 ? IDS_PRINT_JOB_NOTIFICATION_MESSAGE 239 message = l10n_util::GetStringFUTF16(
240 : IDS_PRINT_JOB_NOTIFICATION_SINGLE_PAGE_MESSAGE, 240 IDS_PRINT_JOB_NOTIFICATION_MESSAGE,
241 base::IntToString16(print_job_->total_page_number()), 241 base::IntToString16(print_job_->total_page_number()),
242 base::UTF8ToUTF16(print_job_->printer().display_name())); 242 base::UTF8ToUTF16(print_job_->printer().display_name()));
243 } else {
244 message = l10n_util::GetStringFUTF16(
245 IDS_PRINT_JOB_NOTIFICATION_SINGLE_PAGE_MESSAGE,
246 base::UTF8ToUTF16(print_job_->printer().display_name()));
247 }
243 notification_->set_message(message); 248 notification_->set_message(message);
244 } 249 }
245 250
246 void CupsPrintJobNotification::UpdateNotificationType() { 251 void CupsPrintJobNotification::UpdateNotificationType() {
247 switch (print_job_->state()) { 252 switch (print_job_->state()) {
248 case CupsPrintJob::State::STATE_WAITING: 253 case CupsPrintJob::State::STATE_WAITING:
249 case CupsPrintJob::State::STATE_STARTED: 254 case CupsPrintJob::State::STATE_STARTED:
250 case CupsPrintJob::State::STATE_PAGE_DONE: 255 case CupsPrintJob::State::STATE_PAGE_DONE:
251 case CupsPrintJob::State::STATE_SUSPENDED: 256 case CupsPrintJob::State::STATE_SUSPENDED:
252 case CupsPrintJob::State::STATE_RESUMED: 257 case CupsPrintJob::State::STATE_RESUMED:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 icon = bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_PLAY); 337 icon = bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_PLAY);
333 break; 338 break;
334 case ButtonCommand::GET_HELP: 339 case ButtonCommand::GET_HELP:
335 icon = bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_HELP); 340 icon = bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_HELP);
336 break; 341 break;
337 } 342 }
338 return icon; 343 return icon;
339 } 344 }
340 345
341 } // namespace chromeos 346 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698