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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 printer_data->GetString(kPrinterDescValue, | 630 printer_data->GetString(kPrinterDescValue, |
631 &printer_info.printer_description); | 631 &printer_info.printer_description); |
632 // Printer status is a string value which actually contains an integer. | 632 // Printer status is a string value which actually contains an integer. |
633 std::string printer_status; | 633 std::string printer_status; |
634 if (printer_data->GetString(kPrinterStatusValue, &printer_status)) { | 634 if (printer_data->GetString(kPrinterStatusValue, &printer_status)) { |
635 base::StringToInt(printer_status, &printer_info.printer_status); | 635 base::StringToInt(printer_status, &printer_info.printer_status); |
636 } | 636 } |
637 printer_data->GetString(kPrinterCapsHashValue, | 637 printer_data->GetString(kPrinterCapsHashValue, |
638 &printer_info_cloud.caps_hash); | 638 &printer_info_cloud.caps_hash); |
639 ListValue* tags_list = NULL; | 639 ListValue* tags_list = NULL; |
640 printer_data->GetList(kPrinterTagsValue, &tags_list); | 640 printer_data->GetList(kTagsValue, &tags_list); |
641 if (tags_list) { | 641 if (tags_list) { |
642 for (size_t index = 0; index < tags_list->GetSize(); index++) { | 642 for (size_t index = 0; index < tags_list->GetSize(); index++) { |
643 std::string tag; | 643 std::string tag; |
644 tags_list->GetString(index, &tag); | 644 tags_list->GetString(index, &tag); |
645 if (StartsWithASCII(tag, kTagsHashTagName, false)) { | 645 if (StartsWithASCII(tag, kTagsHashTagName, false)) { |
646 std::vector<std::string> tag_parts; | 646 std::vector<std::string> tag_parts; |
647 base::SplitStringDontTrim(tag, '=', &tag_parts); | 647 base::SplitStringDontTrim(tag, '=', &tag_parts); |
648 DCHECK_EQ(tag_parts.size(), 2U); | 648 DCHECK_EQ(tag_parts.size(), 2U); |
649 if (tag_parts.size() == 2) | 649 if (tag_parts.size() == 2) |
650 printer_info_cloud.tags_hash = tag_parts[1]; | 650 printer_info_cloud.tags_hash = tag_parts[1]; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 VLOG(1) << "CP_PROXY: Printer job handle shutdown, id " << printer_id; | 755 VLOG(1) << "CP_PROXY: Printer job handle shutdown, id " << printer_id; |
756 job_handler_map_.erase(printer_id); | 756 job_handler_map_.erase(printer_id); |
757 } | 757 } |
758 | 758 |
759 void CloudPrintProxyBackend::Core::OnAuthError() { | 759 void CloudPrintProxyBackend::Core::OnAuthError() { |
760 DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop()); | 760 DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop()); |
761 VLOG(1) << "CP_PROXY: Auth Error"; | 761 VLOG(1) << "CP_PROXY: Auth Error"; |
762 backend_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, | 762 backend_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, |
763 &Core::NotifyAuthenticationFailed)); | 763 &Core::NotifyAuthenticationFailed)); |
764 } | 764 } |
OLD | NEW |