| 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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 | 767 |
| 768 base::DictionaryValue initial_settings; | 768 base::DictionaryValue initial_settings; |
| 769 initial_settings.SetString(kInitiatorTabTitle, | 769 initial_settings.SetString(kInitiatorTabTitle, |
| 770 print_preview_ui->initiator_tab_title()); | 770 print_preview_ui->initiator_tab_title()); |
| 771 initial_settings.SetBoolean(printing::kSettingPreviewModifiable, | 771 initial_settings.SetBoolean(printing::kSettingPreviewModifiable, |
| 772 print_preview_ui->source_is_modifiable()); | 772 print_preview_ui->source_is_modifiable()); |
| 773 initial_settings.SetString(printing::kSettingPrinterName, default_printer); | 773 initial_settings.SetString(printing::kSettingPrinterName, default_printer); |
| 774 initial_settings.SetBoolean(kDocumentHasSelection, | 774 initial_settings.SetBoolean(kDocumentHasSelection, |
| 775 print_preview_ui->source_has_selection()); | 775 print_preview_ui->source_has_selection()); |
| 776 initial_settings.SetBoolean(printing::kSettingShouldPrintSelectionOnly, | 776 initial_settings.SetBoolean(printing::kSettingShouldPrintSelectionOnly, |
| 777 false); | 777 print_preview_ui->print_selection_only()); |
| 778 printing::StickySettings* sticky_settings = GetStickySettings(); | 778 printing::StickySettings* sticky_settings = GetStickySettings(); |
| 779 sticky_settings->RestoreFromPrefs(Profile::FromBrowserContext( | 779 sticky_settings->RestoreFromPrefs(Profile::FromBrowserContext( |
| 780 preview_web_contents()->GetBrowserContext())->GetPrefs()); | 780 preview_web_contents()->GetBrowserContext())->GetPrefs()); |
| 781 if (sticky_settings->printer_app_state()) | 781 if (sticky_settings->printer_app_state()) |
| 782 initial_settings.SetString(kAppState, | 782 initial_settings.SetString(kAppState, |
| 783 *sticky_settings->printer_app_state()); | 783 *sticky_settings->printer_app_state()); |
| 784 | 784 |
| 785 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 785 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
| 786 initial_settings.SetBoolean(kPrintAutomaticallyInKioskMode, | 786 initial_settings.SetBoolean(kPrintAutomaticallyInKioskMode, |
| 787 cmdline->HasSwitch(switches::kKioskModePrinting)); | 787 cmdline->HasSwitch(switches::kKioskModePrinting)); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 // Nothing to print, no preview available. | 982 // Nothing to print, no preview available. |
| 983 return false; | 983 return false; |
| 984 } | 984 } |
| 985 DCHECK(tmp_data->size() && tmp_data->front()); | 985 DCHECK(tmp_data->size() && tmp_data->front()); |
| 986 | 986 |
| 987 *data = tmp_data; | 987 *data = tmp_data; |
| 988 *title = print_preview_ui->initiator_tab_title(); | 988 *title = print_preview_ui->initiator_tab_title(); |
| 989 return true; | 989 return true; |
| 990 } | 990 } |
| 991 | 991 |
| OLD | NEW |