| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview_handler.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 8 #include "content/browser/renderer_host/render_view_host.h" |
| 9 #include "printing/backend/print_backend.h" | 9 #include "printing/backend/print_backend.h" |
| 10 | 10 |
| 11 PrintPreviewHandler::PrintPreviewHandler() | 11 PrintPreviewHandler::PrintPreviewHandler() |
| 12 : print_backend_(printing::PrintBackend::CreateInstance(NULL)) { | 12 : print_backend_(printing::PrintBackend::CreateInstance(NULL)) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 PrintPreviewHandler::~PrintPreviewHandler() { | 15 PrintPreviewHandler::~PrintPreviewHandler() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 void PrintPreviewHandler::RegisterMessages() { | 18 void PrintPreviewHandler::RegisterMessages() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 index != printer_list.end(); ++index) { | 31 index != printer_list.end(); ++index) { |
| 32 printers.Append(new StringValue(index->printer_name)); | 32 printers.Append(new StringValue(index->printer_name)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 web_ui_->CallJavascriptFunction(L"setPrinters", printers); | 35 web_ui_->CallJavascriptFunction(L"setPrinters", printers); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void PrintPreviewHandler::HandlePrint(const ListValue*) { | 38 void PrintPreviewHandler::HandlePrint(const ListValue*) { |
| 39 web_ui_->GetRenderViewHost()->PrintForPrintPreview(); | 39 web_ui_->GetRenderViewHost()->PrintForPrintPreview(); |
| 40 } | 40 } |
| OLD | NEW |