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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 bool display_header_footer = false; | 646 bool display_header_footer = false; |
647 if (!settings->GetBoolean(printing::kSettingHeaderFooterEnabled, | 647 if (!settings->GetBoolean(printing::kSettingHeaderFooterEnabled, |
648 &display_header_footer)) { | 648 &display_header_footer)) { |
649 NOTREACHED(); | 649 NOTREACHED(); |
650 } | 650 } |
651 if (display_header_footer) { | 651 if (display_header_footer) { |
652 settings->SetString(printing::kSettingHeaderFooterTitle, | 652 settings->SetString(printing::kSettingHeaderFooterTitle, |
653 initiator->GetTitle()); | 653 initiator->GetTitle()); |
654 std::string url; | 654 std::string url; |
655 content::NavigationEntry* entry = | 655 content::NavigationEntry* entry = |
656 initiator->GetController().GetActiveEntry(); | 656 initiator->GetController().GetLastCommittedEntry(); |
657 if (entry) | 657 if (entry) |
658 url = entry->GetVirtualURL().spec(); | 658 url = entry->GetVirtualURL().spec(); |
659 settings->SetString(printing::kSettingHeaderFooterURL, url); | 659 settings->SetString(printing::kSettingHeaderFooterURL, url); |
660 } | 660 } |
661 | 661 |
662 bool generate_draft_data = false; | 662 bool generate_draft_data = false; |
663 bool success = settings->GetBoolean(printing::kSettingGenerateDraftData, | 663 bool success = settings->GetBoolean(printing::kSettingGenerateDraftData, |
664 &generate_draft_data); | 664 &generate_draft_data); |
665 DCHECK(success); | 665 DCHECK(success); |
666 | 666 |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 | 1549 |
1550 void PrintPreviewHandler::FillPrinterDescription( | 1550 void PrintPreviewHandler::FillPrinterDescription( |
1551 const std::string& name, | 1551 const std::string& name, |
1552 const local_discovery::DeviceDescription& description, | 1552 const local_discovery::DeviceDescription& description, |
1553 base::DictionaryValue* printer_value) { | 1553 base::DictionaryValue* printer_value) { |
1554 printer_value->SetString("serviceName", name); | 1554 printer_value->SetString("serviceName", name); |
1555 printer_value->SetString("name", description.name); | 1555 printer_value->SetString("name", description.name); |
1556 } | 1556 } |
1557 | 1557 |
1558 #endif | 1558 #endif |
OLD | NEW |