OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 PrintersMap printer_map_; | 127 PrintersMap printer_map_; |
128 | 128 |
129 int update_timeout_; | 129 int update_timeout_; |
130 bool initialized_; | 130 bool initialized_; |
131 }; | 131 }; |
132 | 132 |
133 class PrintServerWatcherCUPS | 133 class PrintServerWatcherCUPS |
134 : public PrintSystem::PrintServerWatcher { | 134 : public PrintSystem::PrintServerWatcher { |
135 public: | 135 public: |
136 explicit PrintServerWatcherCUPS(PrintSystemCUPS* print_system) | 136 explicit PrintServerWatcherCUPS(PrintSystemCUPS* print_system) |
137 : print_system_(print_system) { | 137 : print_system_(print_system), |
| 138 delegate_(NULL) { |
138 } | 139 } |
139 ~PrintServerWatcherCUPS() { | 140 ~PrintServerWatcherCUPS() { |
140 StopWatching(); | 141 StopWatching(); |
141 } | 142 } |
142 | 143 |
143 // PrintSystem::PrintServerWatcher interface | 144 // PrintSystem::PrintServerWatcher interface |
144 virtual bool StartWatching( | 145 virtual bool StartWatching( |
145 PrintSystem::PrintServerWatcher::Delegate* delegate) { | 146 PrintSystem::PrintServerWatcher::Delegate* delegate) { |
146 delegate_ = delegate; | 147 delegate_ = delegate; |
147 printers_hash_ = GetPrintersHash(); | 148 printers_hash_ = GetPrintersHash(); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 job_title.c_str(), | 635 job_title.c_str(), |
635 cups_options.size(), | 636 cups_options.size(), |
636 &(cups_options[0])); | 637 &(cups_options[0])); |
637 | 638 |
638 VLOG(1) << "CP_CUPS: Job spooled, id: " << job_id; | 639 VLOG(1) << "CP_CUPS: Job spooled, id: " << job_id; |
639 | 640 |
640 return job_id; | 641 return job_id; |
641 } | 642 } |
642 | 643 |
643 } // namespace cloud_print | 644 } // namespace cloud_print |
OLD | NEW |