| 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_ui.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 void PrintPreviewUI::OnReloadPrintersList() { | 625 void PrintPreviewUI::OnReloadPrintersList() { |
| 626 web_ui()->CallJavascriptFunction("reloadPrintersList"); | 626 web_ui()->CallJavascriptFunction("reloadPrintersList"); |
| 627 } | 627 } |
| 628 | 628 |
| 629 void PrintPreviewUI::OnSetOptionsFromDocument( | 629 void PrintPreviewUI::OnSetOptionsFromDocument( |
| 630 const PrintHostMsg_SetOptionsFromDocument_Params& params) { | 630 const PrintHostMsg_SetOptionsFromDocument_Params& params) { |
| 631 base::DictionaryValue options; | 631 base::DictionaryValue options; |
| 632 options.SetBoolean(printing::kSettingDisableScaling, | 632 options.SetBoolean(printing::kSettingDisableScaling, |
| 633 params.is_scaling_disabled); | 633 params.is_scaling_disabled); |
| 634 options.SetInteger(printing::kSettingCopies, params.copies); | 634 options.SetInteger(printing::kSettingCopies, params.copies); |
| 635 options.SetInteger(printing::kSettingDuplexMode, params.duplex); |
| 635 web_ui()->CallJavascriptFunction("printPresetOptionsFromDocument", options); | 636 web_ui()->CallJavascriptFunction("printPresetOptionsFromDocument", options); |
| 636 } | 637 } |
| 637 | 638 |
| 638 // static | 639 // static |
| 639 void PrintPreviewUI::SetDelegateForTesting(TestingDelegate* delegate) { | 640 void PrintPreviewUI::SetDelegateForTesting(TestingDelegate* delegate) { |
| 640 g_testing_delegate = delegate; | 641 g_testing_delegate = delegate; |
| 641 } | 642 } |
| 642 | 643 |
| 643 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { | 644 void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) { |
| 644 handler_->FileSelected(path, 0, NULL); | 645 handler_->FileSelected(path, 0, NULL); |
| 645 } | 646 } |
| 646 | 647 |
| 647 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 648 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 648 const base::Closure& closure) { | 649 const base::Closure& closure) { |
| 649 handler_->SetPdfSavedClosureForTesting(closure); | 650 handler_->SetPdfSavedClosureForTesting(closure); |
| 650 } | 651 } |
| OLD | NEW |