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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 | 1369 |
1370 #if defined(ENABLE_SERVICE_DISCOVERY) | 1370 #if defined(ENABLE_SERVICE_DISCOVERY) |
1371 | 1371 |
1372 void PrintPreviewHandler::StartPrivetLister(const scoped_refptr< | 1372 void PrintPreviewHandler::StartPrivetLister(const scoped_refptr< |
1373 local_discovery::ServiceDiscoverySharedClient>& client) { | 1373 local_discovery::ServiceDiscoverySharedClient>& client) { |
1374 if (!PrivetPrintingEnabled()) | 1374 if (!PrivetPrintingEnabled()) |
1375 return web_ui()->CallJavascriptFunction("onPrivetPrinterSearchDone"); | 1375 return web_ui()->CallJavascriptFunction("onPrivetPrinterSearchDone"); |
1376 | 1376 |
1377 Profile* profile = Profile::FromWebUI(web_ui()); | 1377 Profile* profile = Profile::FromWebUI(web_ui()); |
1378 DCHECK(!service_discovery_client_.get() || | 1378 DCHECK(!service_discovery_client_.get() || |
1379 service_discovery_client_ == client); | 1379 service_discovery_client_.get() == client.get()); |
1380 service_discovery_client_ = client; | 1380 service_discovery_client_ = client; |
1381 printer_lister_.reset(new local_discovery::PrivetLocalPrinterLister( | 1381 printer_lister_.reset(new local_discovery::PrivetLocalPrinterLister( |
1382 service_discovery_client_.get(), profile->GetRequestContext(), this)); | 1382 service_discovery_client_.get(), profile->GetRequestContext(), this)); |
1383 printer_lister_->Start(); | 1383 printer_lister_->Start(); |
1384 } | 1384 } |
1385 | 1385 |
1386 void PrintPreviewHandler::LocalPrinterChanged( | 1386 void PrintPreviewHandler::LocalPrinterChanged( |
1387 bool added, | 1387 bool added, |
1388 const std::string& name, | 1388 const std::string& name, |
1389 bool has_local_printing, | 1389 bool has_local_printing, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 | 1595 |
1596 void PrintPreviewHandler::UnregisterForMergeSession() { | 1596 void PrintPreviewHandler::UnregisterForMergeSession() { |
1597 if (reconcilor_) | 1597 if (reconcilor_) |
1598 reconcilor_->RemoveMergeSessionObserver(this); | 1598 reconcilor_->RemoveMergeSessionObserver(this); |
1599 } | 1599 } |
1600 | 1600 |
1601 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1601 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1602 const base::Closure& closure) { | 1602 const base::Closure& closure) { |
1603 pdf_file_saved_closure_ = closure; | 1603 pdf_file_saved_closure_ = closure; |
1604 } | 1604 } |
OLD | NEW |