OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/service/cloud_print/print_system.h" | 5 #include "chrome/service/cloud_print/print_system.h" |
6 | 6 |
7 #include <cups/cups.h> | 7 #include <cups/cups.h> |
8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <pthread.h> | 10 #include <pthread.h> |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 scoped_refptr<PrintSystemCUPS> print_system_; | 230 scoped_refptr<PrintSystemCUPS> print_system_; |
231 PrintSystem::PrintServerWatcher::Delegate* delegate_; | 231 PrintSystem::PrintServerWatcher::Delegate* delegate_; |
232 std::string printers_hash_; | 232 std::string printers_hash_; |
233 DISALLOW_COPY_AND_ASSIGN(PrintServerWatcherCUPS); | 233 DISALLOW_COPY_AND_ASSIGN(PrintServerWatcherCUPS); |
234 }; | 234 }; |
235 | 235 |
236 class PrinterWatcherCUPS | 236 class PrinterWatcherCUPS |
237 : public PrintSystem::PrinterWatcher { | 237 : public PrintSystem::PrinterWatcher { |
238 public: | 238 public: |
239 explicit PrinterWatcherCUPS(PrintSystemCUPS* print_system, | 239 PrinterWatcherCUPS(PrintSystemCUPS* print_system, |
240 const std::string& printer_name) | 240 const std::string& printer_name) |
241 : printer_name_(printer_name), | 241 : printer_name_(printer_name), |
242 delegate_(NULL), | 242 delegate_(NULL), |
243 print_system_(print_system) { | 243 print_system_(print_system) { |
244 } | 244 } |
245 ~PrinterWatcherCUPS() { | 245 ~PrinterWatcherCUPS() { |
246 StopWatching(); | 246 StopWatching(); |
247 } | 247 } |
248 | 248 |
249 // PrintSystem::PrinterWatcher interface | 249 // PrintSystem::PrinterWatcher interface |
250 virtual bool StartWatching( | 250 virtual bool StartWatching( |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 void PrintSystemCUPS::RunCapsCallback( | 811 void PrintSystemCUPS::RunCapsCallback( |
812 PrinterCapsAndDefaultsCallback* callback, | 812 PrinterCapsAndDefaultsCallback* callback, |
813 bool succeeded, | 813 bool succeeded, |
814 const std::string& printer_name, | 814 const std::string& printer_name, |
815 const printing::PrinterCapsAndDefaults& printer_info) { | 815 const printing::PrinterCapsAndDefaults& printer_info) { |
816 callback->Run(succeeded, printer_name, printer_info); | 816 callback->Run(succeeded, printer_name, printer_info); |
817 delete callback; | 817 delete callback; |
818 } | 818 } |
819 | 819 |
820 } // namespace cloud_print | 820 } // namespace cloud_print |
OLD | NEW |