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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Profile::FromWebUI(web_ui())->GetRequestContext()); | 1624 Profile::FromWebUI(web_ui())->GetRequestContext()); |
1625 privet_http_resolution_ = privet_http_factory_->CreatePrivetHTTP( | 1625 privet_http_resolution_ = privet_http_factory_->CreatePrivetHTTP(name); |
1626 name, device_description->address, callback); | 1626 privet_http_resolution_->Start(device_description->address, callback); |
1627 privet_http_resolution_->Start(); | |
1628 | 1627 |
1629 return true; | 1628 return true; |
1630 } | 1629 } |
1631 | 1630 |
1632 void PrintPreviewHandler::OnPrivetPrintingDone( | 1631 void PrintPreviewHandler::OnPrivetPrintingDone( |
1633 const local_discovery::PrivetLocalPrintOperation* print_operation) { | 1632 const local_discovery::PrivetLocalPrintOperation* print_operation) { |
1634 ClosePreviewDialog(); | 1633 ClosePreviewDialog(); |
1635 } | 1634 } |
1636 | 1635 |
1637 void PrintPreviewHandler::OnPrivetPrintingError( | 1636 void PrintPreviewHandler::OnPrivetPrintingError( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 | 1712 |
1714 void PrintPreviewHandler::UnregisterForMergeSession() { | 1713 void PrintPreviewHandler::UnregisterForMergeSession() { |
1715 if (reconcilor_) | 1714 if (reconcilor_) |
1716 reconcilor_->RemoveMergeSessionObserver(this); | 1715 reconcilor_->RemoveMergeSessionObserver(this); |
1717 } | 1716 } |
1718 | 1717 |
1719 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1718 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1720 const base::Closure& closure) { | 1719 const base::Closure& closure) { |
1721 pdf_file_saved_closure_ = closure; | 1720 pdf_file_saved_closure_ = closure; |
1722 } | 1721 } |
OLD | NEW |