Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 99093007: Enable Privet Local Printing by Default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698