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 <string> | 9 #include <string> |
10 | 10 |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 base::Unretained(this))); | 547 base::Unretained(this))); |
548 web_ui()->RegisterMessageCallback("getPrivetPrinterCapabilities", | 548 web_ui()->RegisterMessageCallback("getPrivetPrinterCapabilities", |
549 base::Bind(&PrintPreviewHandler::HandleGetPrivetPrinterCapabilities, | 549 base::Bind(&PrintPreviewHandler::HandleGetPrivetPrinterCapabilities, |
550 base::Unretained(this))); | 550 base::Unretained(this))); |
551 } | 551 } |
552 | 552 |
553 bool PrintPreviewHandler::PrivetPrintingEnabled() { | 553 bool PrintPreviewHandler::PrivetPrintingEnabled() { |
554 #if defined(ENABLE_MDNS) | 554 #if defined(ENABLE_MDNS) |
555 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 555 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
556 return !command_line->HasSwitch(switches::kDisableDeviceDiscovery) && | 556 return !command_line->HasSwitch(switches::kDisableDeviceDiscovery) && |
557 command_line->HasSwitch(switches::kEnablePrivetLocalPrinting); | 557 !command_line->HasSwitch(switches::kDisablePrivetLocalPrinting); |
558 #else | 558 #else |
559 return false; | 559 return false; |
560 #endif | 560 #endif |
561 } | 561 } |
562 | 562 |
563 WebContents* PrintPreviewHandler::preview_web_contents() const { | 563 WebContents* PrintPreviewHandler::preview_web_contents() const { |
564 return web_ui()->GetWebContents(); | 564 return web_ui()->GetWebContents(); |
565 } | 565 } |
566 | 566 |
567 void PrintPreviewHandler::HandleGetPrinters(const ListValue* /*args*/) { | 567 void PrintPreviewHandler::HandleGetPrinters(const ListValue* /*args*/) { |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 | 1554 |
1555 void PrintPreviewHandler::FillPrinterDescription( | 1555 void PrintPreviewHandler::FillPrinterDescription( |
1556 const std::string& name, | 1556 const std::string& name, |
1557 const local_discovery::DeviceDescription& description, | 1557 const local_discovery::DeviceDescription& description, |
1558 base::DictionaryValue* printer_value) { | 1558 base::DictionaryValue* printer_value) { |
1559 printer_value->SetString("serviceName", name); | 1559 printer_value->SetString("serviceName", name); |
1560 printer_value->SetString("name", description.name); | 1560 printer_value->SetString("name", description.name); |
1561 } | 1561 } |
1562 | 1562 |
1563 #endif | 1563 #endif |
OLD | NEW |