| 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_connector.h" | 5 #include "chrome/service/cloud_print/cloud_print_connector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/md5.h" | 10 #include "base/md5.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 if (printer_data->GetString(kPrinterStatusValue, &printer_status)) { | 411 if (printer_data->GetString(kPrinterStatusValue, &printer_status)) { |
| 412 base::StringToInt(printer_status, &printer_info.printer_status); | 412 base::StringToInt(printer_status, &printer_info.printer_status); |
| 413 } | 413 } |
| 414 printer_data->GetString(kPrinterCapsHashValue, | 414 printer_data->GetString(kPrinterCapsHashValue, |
| 415 &printer_info_cloud.caps_hash); | 415 &printer_info_cloud.caps_hash); |
| 416 base::ListValue* tags_list = NULL; | 416 base::ListValue* tags_list = NULL; |
| 417 if (printer_data->GetList(kTagsValue, &tags_list) && tags_list) { | 417 if (printer_data->GetList(kTagsValue, &tags_list) && tags_list) { |
| 418 for (size_t index = 0; index < tags_list->GetSize(); index++) { | 418 for (size_t index = 0; index < tags_list->GetSize(); index++) { |
| 419 std::string tag; | 419 std::string tag; |
| 420 if (tags_list->GetString(index, &tag) && | 420 if (tags_list->GetString(index, &tag) && |
| 421 StartsWithASCII(tag, kCloudPrintServiceTagsHashTagName, false)) { | 421 base::StartsWithASCII(tag, kCloudPrintServiceTagsHashTagName, |
| 422 false)) { |
| 422 std::vector<std::string> tag_parts; | 423 std::vector<std::string> tag_parts; |
| 423 base::SplitStringDontTrim(tag, '=', &tag_parts); | 424 base::SplitStringDontTrim(tag, '=', &tag_parts); |
| 424 DCHECK_EQ(tag_parts.size(), 2U); | 425 DCHECK_EQ(tag_parts.size(), 2U); |
| 425 if (tag_parts.size() == 2) | 426 if (tag_parts.size() == 2) |
| 426 printer_info_cloud.tags_hash = tag_parts[1]; | 427 printer_info_cloud.tags_hash = tag_parts[1]; |
| 427 } | 428 } |
| 428 } | 429 } |
| 429 } | 430 } |
| 430 | 431 |
| 431 int xmpp_timeout = 0; | 432 int xmpp_timeout = 0; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 kCloudPrintAPIMaxRetryCount, mime_type, post_data, | 650 kCloudPrintAPIMaxRetryCount, mime_type, post_data, |
| 650 &CloudPrintConnector::HandleRegisterPrinterResponse); | 651 &CloudPrintConnector::HandleRegisterPrinterResponse); |
| 651 } | 652 } |
| 652 | 653 |
| 653 bool CloudPrintConnector::IsSamePrinter(const std::string& name1, | 654 bool CloudPrintConnector::IsSamePrinter(const std::string& name1, |
| 654 const std::string& name2) const { | 655 const std::string& name2) const { |
| 655 return (0 == base::strcasecmp(name1.c_str(), name2.c_str())); | 656 return (0 == base::strcasecmp(name1.c_str(), name2.c_str())); |
| 656 } | 657 } |
| 657 | 658 |
| 658 } // namespace cloud_print | 659 } // namespace cloud_print |
| OLD | NEW |