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

Side by Side Diff: chrome/browser/chromeos/printing/cups_print_job_notification_manager.h

Issue 2708233006: Report print jobs that are aborted by CUPS as errors. (Closed)
Patch Set: address comments from xdai 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
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 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_NOTIFICATION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_NOTIFICATION_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_NOTIFICATION_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_NOTIFICATION_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <unordered_map> 10 #include <unordered_map>
11 11
12 #include "base/macros.h"
12 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h" 13 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h"
13 #include "chrome/browser/chromeos/printing/cups_print_job_notification.h" 14 #include "chrome/browser/chromeos/printing/cups_print_job_notification.h"
14 15
15 class Profile; 16 class Profile;
16 17
17 namespace chromeos { 18 namespace chromeos {
18 19
19 class CupsPrintJob; 20 class CupsPrintJob;
20 21
21 class CupsPrintJobNotificationManager : public CupsPrintJobManager::Observer { 22 class CupsPrintJobNotificationManager : public CupsPrintJobManager::Observer {
22 public: 23 public:
23 using PrintJobNotificationMap = 24 using PrintJobNotificationMap =
24 std::unordered_map<CupsPrintJob*, 25 std::unordered_map<CupsPrintJob*,
25 std::unique_ptr<CupsPrintJobNotification>>; 26 std::unique_ptr<CupsPrintJobNotification>>;
26 27
27 CupsPrintJobNotificationManager(Profile* profile, 28 CupsPrintJobNotificationManager(Profile* profile,
28 CupsPrintJobManager* print_job_manager); 29 CupsPrintJobManager* print_job_manager);
29 ~CupsPrintJobNotificationManager() override; 30 ~CupsPrintJobNotificationManager() override;
30 31
31 // CupsPrintJobManager::Observer overrides: 32 // CupsPrintJobManager::Observer overrides:
32 void OnPrintJobCreated(CupsPrintJob* job) override; 33 void OnPrintJobCreated(CupsPrintJob* job) override;
33 void OnPrintJobStarted(CupsPrintJob* job) override; 34 void OnPrintJobStarted(CupsPrintJob* job) override;
34 void OnPrintJobUpdated(CupsPrintJob* job) override; 35 void OnPrintJobUpdated(CupsPrintJob* job) override;
35 void OnPrintJobSuspended(CupsPrintJob* job) override; 36 void OnPrintJobSuspended(CupsPrintJob* job) override;
36 void OnPrintJobResumed(CupsPrintJob* job) override; 37 void OnPrintJobResumed(CupsPrintJob* job) override;
37 void OnPrintJobDone(CupsPrintJob* job) override; 38 void OnPrintJobDone(CupsPrintJob* job) override;
38 void OnPrintJobError(CupsPrintJob* job) override; 39 void OnPrintJobError(CupsPrintJob* job) override;
40 void OnPrintJobCancelled(CupsPrintJob* job) override;
39 41
40 private: 42 private:
43 void UpdateNotification(CupsPrintJob* job);
44
41 PrintJobNotificationMap notification_map_; 45 PrintJobNotificationMap notification_map_;
42 CupsPrintJobManager* print_job_manager_; 46 CupsPrintJobManager* print_job_manager_;
43 Profile* profile_; 47 Profile* profile_;
44 48
45 DISALLOW_COPY_AND_ASSIGN(CupsPrintJobNotificationManager); 49 DISALLOW_COPY_AND_ASSIGN(CupsPrintJobNotificationManager);
46 }; 50 };
47 51
48 } // namespace chromeos 52 } // namespace chromeos
49 53
50 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_NOTIFICATION_MANAGER_ H_ 54 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_NOTIFICATION_MANAGER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698