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

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

Issue 974183003: Print Preview: Support the duplex preset in PDFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tsepez comments Created 5 years, 9 months 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
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_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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698