| 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/md5.h" | 8 #include "base/md5.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // the CloudPrintProxyCoreThread and we cannot really do anything else until | 241 // the CloudPrintProxyCoreThread and we cannot really do anything else until |
| 242 // the GAIA signin is successful. | 242 // the GAIA signin is successful. |
| 243 std::string user_agent = "ChromiumBrowser"; | 243 std::string user_agent = "ChromiumBrowser"; |
| 244 scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_talk = | 244 scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_talk = |
| 245 new ServiceGaiaAuthenticator( | 245 new ServiceGaiaAuthenticator( |
| 246 user_agent, kSyncGaiaServiceId, kGaiaUrl, | 246 user_agent, kSyncGaiaServiceId, kGaiaUrl, |
| 247 g_service_process->io_thread()->message_loop_proxy()); | 247 g_service_process->io_thread()->message_loop_proxy()); |
| 248 gaia_auth_for_talk->set_message_loop(MessageLoop::current()); | 248 gaia_auth_for_talk->set_message_loop(MessageLoop::current()); |
| 249 // TODO(sanjeevr): Handle auth failure case. We basically need to disable | 249 // TODO(sanjeevr): Handle auth failure case. We basically need to disable |
| 250 // cloud print and shutdown. | 250 // cloud print and shutdown. |
| 251 if (gaia_auth_for_talk->AuthenticateWithLsid(lsid, true)) { | 251 if (gaia_auth_for_talk->AuthenticateWithLsid(lsid)) { |
| 252 scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print = | 252 scoped_refptr<ServiceGaiaAuthenticator> gaia_auth_for_print = |
| 253 new ServiceGaiaAuthenticator( | 253 new ServiceGaiaAuthenticator( |
| 254 user_agent, kCloudPrintGaiaServiceId, kGaiaUrl, | 254 user_agent, kCloudPrintGaiaServiceId, kGaiaUrl, |
| 255 g_service_process->io_thread()->message_loop_proxy()); | 255 g_service_process->io_thread()->message_loop_proxy()); |
| 256 gaia_auth_for_print->set_message_loop(MessageLoop::current()); | 256 gaia_auth_for_print->set_message_loop(MessageLoop::current()); |
| 257 if (gaia_auth_for_print->AuthenticateWithLsid(lsid, true)) { | 257 if (gaia_auth_for_print->AuthenticateWithLsid(lsid)) { |
| 258 // Let the frontend know that we have authenticated. | 258 // Let the frontend know that we have authenticated. |
| 259 backend_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, | 259 backend_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, |
| 260 &Core::NotifyAuthenticated, gaia_auth_for_print->auth_token(), | 260 &Core::NotifyAuthenticated, gaia_auth_for_print->auth_token(), |
| 261 gaia_auth_for_talk->auth_token(), gaia_auth_for_talk->email())); | 261 gaia_auth_for_talk->auth_token(), gaia_auth_for_talk->email())); |
| 262 DoInitializeWithToken(gaia_auth_for_print->auth_token(), | 262 DoInitializeWithToken(gaia_auth_for_print->auth_token(), |
| 263 gaia_auth_for_talk->auth_token(), | 263 gaia_auth_for_talk->auth_token(), |
| 264 gaia_auth_for_talk->email(), | 264 gaia_auth_for_talk->email(), |
| 265 proxy_id); | 265 proxy_id); |
| 266 } | 266 } |
| 267 } | 267 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 StartRegistration(); | 602 StartRegistration(); |
| 603 } | 603 } |
| 604 } | 604 } |
| 605 | 605 |
| 606 // PrinterJobHandler::Delegate implementation | 606 // PrinterJobHandler::Delegate implementation |
| 607 void CloudPrintProxyBackend::Core::OnPrinterJobHandlerShutdown( | 607 void CloudPrintProxyBackend::Core::OnPrinterJobHandlerShutdown( |
| 608 PrinterJobHandler* job_handler, const std::string& printer_id) { | 608 PrinterJobHandler* job_handler, const std::string& printer_id) { |
| 609 job_handler_map_.erase(printer_id); | 609 job_handler_map_.erase(printer_id); |
| 610 } | 610 } |
| 611 | 611 |
| OLD | NEW |