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/cloud_print_proxy_backend.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 const DictionaryValue* print_system_settings) | 262 const DictionaryValue* print_system_settings) |
263 : backend_(backend), | 263 : backend_(backend), |
264 cloud_print_server_url_(cloud_print_server_url), | 264 cloud_print_server_url_(cloud_print_server_url), |
265 next_upload_index_(0), | 265 next_upload_index_(0), |
266 next_response_handler_(NULL), | 266 next_response_handler_(NULL), |
267 new_printers_available_(false), | 267 new_printers_available_(false), |
268 notifications_enabled_(false), | 268 notifications_enabled_(false), |
269 job_poll_scheduled_(false) { | 269 job_poll_scheduled_(false) { |
270 if (print_system_settings) { | 270 if (print_system_settings) { |
271 // It is possible to have no print settings specified. | 271 // It is possible to have no print settings specified. |
272 print_system_settings_.reset( | 272 print_system_settings_.reset(print_system_settings->DeepCopy()); |
273 reinterpret_cast<DictionaryValue*>(print_system_settings->DeepCopy())); | |
274 } | 273 } |
275 } | 274 } |
276 | 275 |
277 void CloudPrintProxyBackend::Core::DoInitializeWithLsid( | 276 void CloudPrintProxyBackend::Core::DoInitializeWithLsid( |
278 const std::string& lsid, const std::string& proxy_id) { | 277 const std::string& lsid, const std::string& proxy_id) { |
279 DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop()); | 278 DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop()); |
280 // Since Talk does not accept a Cloud Print token, for now, we make 2 auth | 279 // Since Talk does not accept a Cloud Print token, for now, we make 2 auth |
281 // requests, one for the chromiumsync service and another for print. This is | 280 // requests, one for the chromiumsync service and another for print. This is |
282 // temporary and should be removed once Talk supports our token. | 281 // temporary and should be removed once Talk supports our token. |
283 // Note: The GAIA login is synchronous but that should be OK because we are in | 282 // Note: The GAIA login is synchronous but that should be OK because we are in |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 VLOG(1) << "CP_PROXY: Printer job handle shutdown, id " << printer_id; | 778 VLOG(1) << "CP_PROXY: Printer job handle shutdown, id " << printer_id; |
780 job_handler_map_.erase(printer_id); | 779 job_handler_map_.erase(printer_id); |
781 } | 780 } |
782 | 781 |
783 void CloudPrintProxyBackend::Core::OnAuthError() { | 782 void CloudPrintProxyBackend::Core::OnAuthError() { |
784 DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop()); | 783 DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop()); |
785 VLOG(1) << "CP_PROXY: Auth Error"; | 784 VLOG(1) << "CP_PROXY: Auth Error"; |
786 backend_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, | 785 backend_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, |
787 &Core::NotifyAuthenticationFailed)); | 786 &Core::NotifyAuthenticationFailed)); |
788 } | 787 } |
OLD | NEW |