| 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/browser/ui/webui/print_preview/print_preview_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 const local_discovery::DeviceDescription* device_description = | 1614 const local_discovery::DeviceDescription* device_description = |
| 1615 printer_lister_ ? printer_lister_->GetDeviceDescription(name) : NULL; | 1615 printer_lister_ ? printer_lister_->GetDeviceDescription(name) : NULL; |
| 1616 | 1616 |
| 1617 if (!device_description) { | 1617 if (!device_description) { |
| 1618 SendPrivetCapabilitiesError(name); | 1618 SendPrivetCapabilitiesError(name); |
| 1619 return false; | 1619 return false; |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 privet_http_factory_ = | 1622 privet_http_factory_ = |
| 1623 local_discovery::PrivetHTTPAsynchronousFactory::CreateInstance( | 1623 local_discovery::PrivetHTTPAsynchronousFactory::CreateInstance( |
| 1624 service_discovery_client_.get(), | |
| 1625 Profile::FromWebUI(web_ui())->GetRequestContext()); | 1624 Profile::FromWebUI(web_ui())->GetRequestContext()); |
| 1626 privet_http_resolution_ = privet_http_factory_->CreatePrivetHTTP( | 1625 privet_http_resolution_ = privet_http_factory_->CreatePrivetHTTP( |
| 1627 name, device_description->address, callback); | 1626 name, device_description->address, callback); |
| 1628 privet_http_resolution_->Start(); | 1627 privet_http_resolution_->Start(); |
| 1629 | 1628 |
| 1630 return true; | 1629 return true; |
| 1631 } | 1630 } |
| 1632 | 1631 |
| 1633 void PrintPreviewHandler::OnPrivetPrintingDone( | 1632 void PrintPreviewHandler::OnPrivetPrintingDone( |
| 1634 const local_discovery::PrivetLocalPrintOperation* print_operation) { | 1633 const local_discovery::PrivetLocalPrintOperation* print_operation) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 | 1713 |
| 1715 void PrintPreviewHandler::UnregisterForMergeSession() { | 1714 void PrintPreviewHandler::UnregisterForMergeSession() { |
| 1716 if (reconcilor_) | 1715 if (reconcilor_) |
| 1717 reconcilor_->RemoveMergeSessionObserver(this); | 1716 reconcilor_->RemoveMergeSessionObserver(this); |
| 1718 } | 1717 } |
| 1719 | 1718 |
| 1720 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1719 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
| 1721 const base::Closure& closure) { | 1720 const base::Closure& closure) { |
| 1722 pdf_file_saved_closure_ = closure; | 1721 pdf_file_saved_closure_ = closure; |
| 1723 } | 1722 } |
| OLD | NEW |