| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 base::Bind(&PrintPreviewHandler::HandleStopGetPrivetPrinters, | 599 base::Bind(&PrintPreviewHandler::HandleStopGetPrivetPrinters, |
| 600 base::Unretained(this))); | 600 base::Unretained(this))); |
| 601 web_ui()->RegisterMessageCallback("getPrivetPrinterCapabilities", | 601 web_ui()->RegisterMessageCallback("getPrivetPrinterCapabilities", |
| 602 base::Bind(&PrintPreviewHandler::HandleGetPrivetPrinterCapabilities, | 602 base::Bind(&PrintPreviewHandler::HandleGetPrivetPrinterCapabilities, |
| 603 base::Unretained(this))); | 603 base::Unretained(this))); |
| 604 RegisterForMergeSession(); | 604 RegisterForMergeSession(); |
| 605 } | 605 } |
| 606 | 606 |
| 607 bool PrintPreviewHandler::PrivetPrintingEnabled() { | 607 bool PrintPreviewHandler::PrivetPrintingEnabled() { |
| 608 #if defined(ENABLE_SERVICE_DISCOVERY) | 608 #if defined(ENABLE_SERVICE_DISCOVERY) |
| 609 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 609 return true; |
| 610 switches::kDisableDeviceDiscovery); | |
| 611 #else | 610 #else |
| 612 return false; | 611 return false; |
| 613 #endif | 612 #endif |
| 614 } | 613 } |
| 615 | 614 |
| 616 WebContents* PrintPreviewHandler::preview_web_contents() const { | 615 WebContents* PrintPreviewHandler::preview_web_contents() const { |
| 617 return web_ui()->GetWebContents(); | 616 return web_ui()->GetWebContents(); |
| 618 } | 617 } |
| 619 | 618 |
| 620 void PrintPreviewHandler::HandleGetPrinters(const base::ListValue* /*args*/) { | 619 void PrintPreviewHandler::HandleGetPrinters(const base::ListValue* /*args*/) { |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 | 1561 |
| 1563 void PrintPreviewHandler::UnregisterForMergeSession() { | 1562 void PrintPreviewHandler::UnregisterForMergeSession() { |
| 1564 if (reconcilor_) | 1563 if (reconcilor_) |
| 1565 reconcilor_->RemoveMergeSessionObserver(this); | 1564 reconcilor_->RemoveMergeSessionObserver(this); |
| 1566 } | 1565 } |
| 1567 | 1566 |
| 1568 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1567 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
| 1569 const base::Closure& closure) { | 1568 const base::Closure& closure) { |
| 1570 pdf_file_saved_closure_ = closure; | 1569 pdf_file_saved_closure_ = closure; |
| 1571 } | 1570 } |
| OLD | NEW |