Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: chrome/service/cloud_print/cloud_print_connector.cc

Issue 1220963005: Update base::StartsWith calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 base::StartsWithASCII(tag, kCloudPrintServiceTagsHashTagName, 421 base::StartsWith(tag, kCloudPrintServiceTagsHashTagName,
422 false)) { 422 base::CompareCase::INSENSITIVE_ASCII)) {
423 std::vector<std::string> tag_parts; 423 std::vector<std::string> tag_parts;
424 base::SplitStringDontTrim(tag, '=', &tag_parts); 424 base::SplitStringDontTrim(tag, '=', &tag_parts);
425 DCHECK_EQ(tag_parts.size(), 2U); 425 DCHECK_EQ(tag_parts.size(), 2U);
426 if (tag_parts.size() == 2) 426 if (tag_parts.size() == 2)
427 printer_info_cloud.tags_hash = tag_parts[1]; 427 printer_info_cloud.tags_hash = tag_parts[1];
428 } 428 }
429 } 429 }
430 } 430 }
431 431
432 int xmpp_timeout = 0; 432 int xmpp_timeout = 0;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 kCloudPrintAPIMaxRetryCount, mime_type, post_data, 650 kCloudPrintAPIMaxRetryCount, mime_type, post_data,
651 &CloudPrintConnector::HandleRegisterPrinterResponse); 651 &CloudPrintConnector::HandleRegisterPrinterResponse);
652 } 652 }
653 653
654 bool CloudPrintConnector::IsSamePrinter(const std::string& name1, 654 bool CloudPrintConnector::IsSamePrinter(const std::string& name1,
655 const std::string& name2) const { 655 const std::string& name2) const {
656 return (0 == base::strcasecmp(name1.c_str(), name2.c_str())); 656 return (0 == base::strcasecmp(name1.c_str(), name2.c_str()));
657 } 657 }
658 658
659 } // namespace cloud_print 659 } // namespace cloud_print
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698