| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ |
| 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // print system specific. For example, CUPS is available on both Linux and Mac, | 67 // print system specific. For example, CUPS is available on both Linux and Mac, |
| 68 // but not available on ChromeOS, etc. This design allows us to add more | 68 // but not available on ChromeOS, etc. This design allows us to add more |
| 69 // functionality on some platforms, while reusing core (CUPS) functions. | 69 // functionality on some platforms, while reusing core (CUPS) functions. |
| 70 class PrintSystem : public base::RefCountedThreadSafe<PrintSystem> { | 70 class PrintSystem : public base::RefCountedThreadSafe<PrintSystem> { |
| 71 public: | 71 public: |
| 72 class PrintServerWatcher | 72 class PrintServerWatcher |
| 73 : public base::RefCountedThreadSafe<PrintServerWatcher> { | 73 : public base::RefCountedThreadSafe<PrintServerWatcher> { |
| 74 public: | 74 public: |
| 75 // Callback interface for new printer notifications. | 75 // Callback interface for new printer notifications. |
| 76 class Delegate { | 76 class Delegate { |
| 77 public: | 77 public: |
| 78 virtual void OnPrinterAdded() = 0; | 78 virtual void OnPrinterAdded() = 0; |
| 79 // TODO(gene): Do we need OnPrinterDeleted notification here? | 79 // TODO(gene): Do we need OnPrinterDeleted notification here? |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 virtual ~Delegate() {} | 82 virtual ~Delegate() {} |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 virtual bool StartWatching(PrintServerWatcher::Delegate* delegate) = 0; | 85 virtual bool StartWatching(PrintServerWatcher::Delegate* delegate) = 0; |
| 86 virtual bool StopWatching() = 0; | 86 virtual bool StopWatching() = 0; |
| 87 | 87 |
| 88 protected: | 88 protected: |
| 89 friend class base::RefCountedThreadSafe<PrintServerWatcher>; | 89 friend class base::RefCountedThreadSafe<PrintServerWatcher>; |
| 90 virtual ~PrintServerWatcher(); | 90 virtual ~PrintServerWatcher(); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class PrinterWatcher : public base::RefCountedThreadSafe<PrinterWatcher> { | 93 class PrinterWatcher : public base::RefCountedThreadSafe<PrinterWatcher> { |
| 94 public: | 94 public: |
| 95 // Callback interface for printer updates notifications. | 95 // Callback interface for printer updates notifications. |
| 96 class Delegate { | 96 class Delegate { |
| 97 public: | 97 public: |
| 98 virtual void OnPrinterDeleted() = 0; | 98 virtual void OnPrinterDeleted() = 0; |
| 99 virtual void OnPrinterChanged() = 0; | 99 virtual void OnPrinterChanged() = 0; |
| 100 virtual void OnJobChanged() = 0; | 100 virtual void OnJobChanged() = 0; |
| 101 | 101 |
| 102 protected: | 102 protected: |
| 103 virtual ~Delegate() {} | 103 virtual ~Delegate() {} |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 virtual bool StartWatching(PrinterWatcher::Delegate* delegate) = 0; | 106 virtual bool StartWatching(PrinterWatcher::Delegate* delegate) = 0; |
| 107 virtual bool StopWatching() = 0; | 107 virtual bool StopWatching() = 0; |
| 108 virtual bool GetCurrentPrinterInfo( | 108 virtual bool GetCurrentPrinterInfo( |
| 109 printing::PrinterBasicInfo* printer_info) = 0; | 109 printing::PrinterBasicInfo* printer_info) = 0; |
| 110 | 110 |
| 111 protected: | 111 protected: |
| 112 friend class base::RefCountedThreadSafe<PrinterWatcher>; | 112 friend class base::RefCountedThreadSafe<PrinterWatcher>; |
| 113 virtual ~PrinterWatcher(); | 113 virtual ~PrinterWatcher(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const base::DictionaryValue* print_system_settings); | 214 const base::DictionaryValue* print_system_settings); |
| 215 | 215 |
| 216 protected: | 216 protected: |
| 217 friend class base::RefCountedThreadSafe<PrintSystem>; | 217 friend class base::RefCountedThreadSafe<PrintSystem>; |
| 218 virtual ~PrintSystem(); | 218 virtual ~PrintSystem(); |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 } // namespace cloud_print | 221 } // namespace cloud_print |
| 222 | 222 |
| 223 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ | 223 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINT_SYSTEM_H_ |
| OLD | NEW |