OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/md5.h" | 7 #include "base/md5.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 } | 192 } |
193 } else { | 193 } else { |
194 NOTREACHED(); | 194 NOTREACHED(); |
195 } | 195 } |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 request_ = NULL; | 199 request_ = NULL; |
200 if (!local_printers.empty()) { | 200 if (!local_printers.empty()) { |
201 // Notify client that we have a list of printers available. | 201 // In the future we might want to notify frontend about available printers |
202 // Client will call us back to finish registration | 202 // and let user choose which printers to register. |
203 client_->OnPrintersAvailable(local_printers); | 203 // Here is a good place to notify client about available printers. |
| 204 RegisterPrinters(local_printers); |
204 } | 205 } |
205 ContinuePendingTaskProcessing(); // Continue processing background tasks. | 206 ContinuePendingTaskProcessing(); // Continue processing background tasks. |
206 return CloudPrintURLFetcher::STOP_PROCESSING; | 207 return CloudPrintURLFetcher::STOP_PROCESSING; |
207 } | 208 } |
208 | 209 |
209 CloudPrintURLFetcher::ResponseAction | 210 CloudPrintURLFetcher::ResponseAction |
210 CloudPrintConnector::HandlePrinterDeleteResponse( | 211 CloudPrintConnector::HandlePrinterDeleteResponse( |
211 const content::URLFetcher* source, | 212 const content::URLFetcher* source, |
212 const GURL& url, | 213 const GURL& url, |
213 DictionaryValue* json_data, | 214 DictionaryValue* json_data, |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 mime_type, | 543 mime_type, |
543 post_data, | 544 post_data, |
544 &CloudPrintConnector::HandleRegisterPrinterResponse); | 545 &CloudPrintConnector::HandleRegisterPrinterResponse); |
545 } | 546 } |
546 | 547 |
547 bool CloudPrintConnector::IsSamePrinter(const std::string& name1, | 548 bool CloudPrintConnector::IsSamePrinter(const std::string& name1, |
548 const std::string& name2) const { | 549 const std::string& name2) const { |
549 return (0 == base::strcasecmp(name1.c_str(), name2.c_str())); | 550 return (0 == base::strcasecmp(name1.c_str(), name2.c_str())); |
550 } | 551 } |
551 | 552 |
OLD | NEW |