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

Side by Side Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed header_footer_info param from IPC call. Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #if !defined(OS_CHROMEOS) 10 #if !defined(OS_CHROMEOS)
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 476
477 TabContents* initiator_tab = GetInitiatorTab(); 477 TabContents* initiator_tab = GetInitiatorTab();
478 if (!initiator_tab) { 478 if (!initiator_tab) {
479 if (!reported_failed_preview_) { 479 if (!reported_failed_preview_) {
480 ReportUserActionHistogram(PREVIEW_FAILED); 480 ReportUserActionHistogram(PREVIEW_FAILED);
481 reported_failed_preview_ = true; 481 reported_failed_preview_ = true;
482 } 482 }
483 print_preview_ui->OnPrintPreviewFailed(); 483 print_preview_ui->OnPrintPreviewFailed();
484 return; 484 return;
485 } 485 }
486
487 bool display_header_footer;
Chris Guillory 2011/07/26 00:10:45 This local isn't used. Do you just want to DCHECK(
Aayush Kumar 2011/07/26 01:55:41 Sorry - this was deprecated code. Removed. On 201
488 if (!settings->GetBoolean(printing::kSettingHeaderFooter,
489 &display_header_footer)) {
490 NOTREACHED();
491 }
492
493 // Retrieving the page title and url and sending it to the renderer process.
Chris Guillory 2011/07/26 00:10:45 Nit: Retrieving -> Retrieve sending -> send
Aayush Kumar 2011/07/26 01:55:41 Done.
494 settings->SetString(printing::kSettingHeaderFooterTitle,
495 initiator_tab->GetTitle());
496 std::string url;
497 NavigationEntry* entry = initiator_tab->controller().GetActiveEntry();
498 if (entry)
499 url = entry->virtual_url().spec();
500 settings->SetString(printing::kSettingHeaderFooterURL, url);
501
486 VLOG(1) << "Print preview request start"; 502 VLOG(1) << "Print preview request start";
487 RenderViewHost* rvh = initiator_tab->render_view_host(); 503 RenderViewHost* rvh = initiator_tab->render_view_host();
488 rvh->Send(new PrintMsg_PrintPreview(rvh->routing_id(), *settings)); 504 rvh->Send(new PrintMsg_PrintPreview(rvh->routing_id(), *settings));
489 } 505 }
490 506
491 void PrintPreviewHandler::HandlePrint(const ListValue* args) { 507 void PrintPreviewHandler::HandlePrint(const ListValue* args) {
492 ReportStats(); 508 ReportStats();
493 509
494 // Record the number of times the user requests to regenerate preview data 510 // Record the number of times the user requests to regenerate preview data
495 // before printing. 511 // before printing.
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 return; 891 return;
876 892
877 // We no longer require the initiator tab details. Remove those details 893 // We no longer require the initiator tab details. Remove those details
878 // associated with the preview tab to allow the initiator tab to create 894 // associated with the preview tab to allow the initiator tab to create
879 // another preview tab. 895 // another preview tab.
880 printing::PrintPreviewTabController* tab_controller = 896 printing::PrintPreviewTabController* tab_controller =
881 printing::PrintPreviewTabController::GetInstance(); 897 printing::PrintPreviewTabController::GetInstance();
882 if (tab_controller) 898 if (tab_controller)
883 tab_controller->EraseInitiatorTabInfo(preview_tab()); 899 tab_controller->EraseInitiatorTabInfo(preview_tab());
884 } 900 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698