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 #include "chrome/service/cloud_print/cloud_print_proxy.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 ConnectorSettings settings; | 192 ConnectorSettings settings; |
193 settings.InitFrom(service_prefs_); | 193 settings.InitFrom(service_prefs_); |
194 info->proxy_id = settings.proxy_id(); | 194 info->proxy_id = settings.proxy_id(); |
195 } | 195 } |
196 | 196 |
197 void CloudPrintProxy::GetPrinters(std::vector<std::string>* printers) { | 197 void CloudPrintProxy::GetPrinters(std::vector<std::string>* printers) { |
198 ConnectorSettings settings; | 198 ConnectorSettings settings; |
199 settings.InitFrom(service_prefs_); | 199 settings.InitFrom(service_prefs_); |
200 scoped_refptr<PrintSystem> print_system = | 200 scoped_refptr<PrintSystem> print_system = |
201 PrintSystem::CreateInstance(settings.print_system_settings()); | 201 PrintSystem::CreateInstance(settings.print_system_settings()); |
202 if (!print_system) | 202 if (!print_system.get()) |
203 return; | 203 return; |
204 PrintSystem::PrintSystemResult result = print_system->Init(); | 204 PrintSystem::PrintSystemResult result = print_system->Init(); |
205 if (!result.succeeded()) | 205 if (!result.succeeded()) |
206 return; | 206 return; |
207 printing::PrinterList printer_list; | 207 printing::PrinterList printer_list; |
208 print_system->EnumeratePrinters(&printer_list); | 208 print_system->EnumeratePrinters(&printer_list); |
209 for (size_t i = 0; i < printer_list.size(); ++i) | 209 for (size_t i = 0; i < printer_list.size(); ++i) |
210 printers->push_back(printer_list[i].printer_name); | 210 printers->push_back(printer_list[i].printer_name); |
211 } | 211 } |
212 | 212 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 286 } |
287 | 287 |
288 void CloudPrintProxy::ShutdownBackend() { | 288 void CloudPrintProxy::ShutdownBackend() { |
289 DCHECK(CalledOnValidThread()); | 289 DCHECK(CalledOnValidThread()); |
290 if (backend_.get()) | 290 if (backend_.get()) |
291 backend_->Shutdown(); | 291 backend_->Shutdown(); |
292 backend_.reset(); | 292 backend_.reset(); |
293 } | 293 } |
294 | 294 |
295 } // namespace cloud_print | 295 } // namespace cloud_print |
OLD | NEW |