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 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 printer_value->SetBoolean( | 1676 printer_value->SetBoolean( |
1677 "isUnregistered", | 1677 "isUnregistered", |
1678 description.id.empty() && | 1678 description.id.empty() && |
1679 command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos)); | 1679 command_line->HasSwitch(switches::kEnablePrintPreviewRegisterPromos)); |
1680 printer_value->SetString("cloudID", description.id); | 1680 printer_value->SetString("cloudID", description.id); |
1681 } | 1681 } |
1682 | 1682 |
1683 #endif // defined(ENABLE_SERVICE_DISCOVERY) | 1683 #endif // defined(ENABLE_SERVICE_DISCOVERY) |
1684 | 1684 |
1685 void PrintPreviewHandler::EnsureExtensionPrinterHandlerSet() { | 1685 void PrintPreviewHandler::EnsureExtensionPrinterHandlerSet() { |
1686 if (extension_printer_handler_.get()) | 1686 if (extension_printer_handler_) |
1687 return; | 1687 return; |
1688 | 1688 |
1689 extension_printer_handler_ = | 1689 extension_printer_handler_ = |
1690 PrinterHandler::CreateForExtensionPrinters(Profile::FromWebUI(web_ui())); | 1690 PrinterHandler::CreateForExtensionPrinters(Profile::FromWebUI(web_ui())); |
1691 } | 1691 } |
1692 | 1692 |
1693 void PrintPreviewHandler::OnGotPrintersForExtension( | 1693 void PrintPreviewHandler::OnGotPrintersForExtension( |
1694 const base::ListValue& printers, | 1694 const base::ListValue& printers, |
1695 bool done) { | 1695 bool done) { |
1696 web_ui()->CallJavascriptFunction("onExtensionPrintersAdded", printers, | 1696 web_ui()->CallJavascriptFunction("onExtensionPrintersAdded", printers, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 | 1736 |
1737 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { | 1737 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { |
1738 if (gaia_cookie_manager_service_) | 1738 if (gaia_cookie_manager_service_) |
1739 gaia_cookie_manager_service_->RemoveObserver(this); | 1739 gaia_cookie_manager_service_->RemoveObserver(this); |
1740 } | 1740 } |
1741 | 1741 |
1742 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1742 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1743 const base::Closure& closure) { | 1743 const base::Closure& closure) { |
1744 pdf_file_saved_closure_ = closure; | 1744 pdf_file_saved_closure_ = closure; |
1745 } | 1745 } |
OLD | NEW |