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

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

Issue 2696763002: Show notifications for waiting jobs. (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « no previous file | 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_manager_impl.h" 5 #include "chrome/browser/chromeos/printing/cups_print_job_manager_impl.h"
6 6
7 #include <cups/cups.h> 7 #include <cups/cups.h>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void CupsPrintJobManagerImpl::JobStateUpdated(CupsPrintJob* job, 217 void CupsPrintJobManagerImpl::JobStateUpdated(CupsPrintJob* job,
218 CupsPrintJob::State new_state) { 218 CupsPrintJob::State new_state) {
219 if (job->state() == new_state) 219 if (job->state() == new_state)
220 return; 220 return;
221 221
222 // We don't track state transitions because some of them might be missed due 222 // We don't track state transitions because some of them might be missed due
223 // to how we query jobs. 223 // to how we query jobs.
224 job->set_state(new_state); 224 job->set_state(new_state);
225 switch (new_state) { 225 switch (new_state) {
226 case CupsPrintJob::State::STATE_NONE: 226 case CupsPrintJob::State::STATE_NONE:
227 // State does not require notification.
228 break;
227 case CupsPrintJob::State::STATE_WAITING: 229 case CupsPrintJob::State::STATE_WAITING:
228 // States do not require notification. 230 NotifyJobUpdated(job);
229 break; 231 break;
230 case CupsPrintJob::State::STATE_STARTED: 232 case CupsPrintJob::State::STATE_STARTED:
231 NotifyJobStarted(job); 233 NotifyJobStarted(job);
232 break; 234 break;
233 case CupsPrintJob::State::STATE_RESUMED: 235 case CupsPrintJob::State::STATE_RESUMED:
234 NotifyJobResumed(job); 236 NotifyJobResumed(job);
235 break; 237 break;
236 case CupsPrintJob::State::STATE_SUSPENDED: 238 case CupsPrintJob::State::STATE_SUSPENDED:
237 NotifyJobSuspended(job); 239 NotifyJobSuspended(job);
238 break; 240 break;
(...skipping 11 matching lines...) Expand all
250 break; 252 break;
251 } 253 }
252 } 254 }
253 255
254 // static 256 // static
255 CupsPrintJobManager* CupsPrintJobManager::CreateInstance(Profile* profile) { 257 CupsPrintJobManager* CupsPrintJobManager::CreateInstance(Profile* profile) {
256 return new CupsPrintJobManagerImpl(profile); 258 return new CupsPrintJobManagerImpl(profile);
257 } 259 }
258 260
259 } // namespace chromeos 261 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698