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

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

Issue 12250008: Cleanup: Remove more uses of deprecated PrintPreviewDialogController methods. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix test Created 7 years, 10 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) 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 ReportPageCount(page_count, "PrintToPrinter"); 465 ReportPageCount(page_count, "PrintToPrinter");
466 ReportUserActionHistogram(PRINT_TO_PRINTER); 466 ReportUserActionHistogram(PRINT_TO_PRINTER);
467 ReportPrintSettingsStats(*settings); 467 ReportPrintSettingsStats(*settings);
468 468
469 // This tries to activate the initiator tab as well, so do not clear the 469 // This tries to activate the initiator tab as well, so do not clear the
470 // association with the initiator tab yet. 470 // association with the initiator tab yet.
471 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( 471 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
472 web_ui()->GetController()); 472 web_ui()->GetController());
473 print_preview_ui->OnHidePreviewDialog(); 473 print_preview_ui->OnHidePreviewDialog();
474 474
475 // Do this so the initiator tab can open a new print preview dialog. 475 // Do this so the initiator tab can open a new print preview dialog, while
476 // the current print preview dialog is still handling its print job.
476 ClearInitiatorTabDetails(); 477 ClearInitiatorTabDetails();
477 478
478 // The PDF being printed contains only the pages that the user selected, 479 // The PDF being printed contains only the pages that the user selected,
479 // so ignore the page range and print all pages. 480 // so ignore the page range and print all pages.
480 settings->Remove(printing::kSettingPageRange, NULL); 481 settings->Remove(printing::kSettingPageRange, NULL);
481 // Set ID to know whether printing is for preview. 482 // Set ID to know whether printing is for preview.
482 settings->SetInteger(printing::kPreviewUIID, 483 settings->SetInteger(printing::kPreviewUIID,
483 print_preview_ui->GetIDForPrintPreviewUI()); 484 print_preview_ui->GetIDForPrintPreviewUI());
484 RenderViewHost* rvh = preview_web_contents()->GetRenderViewHost(); 485 RenderViewHost* rvh = preview_web_contents()->GetRenderViewHost();
485 rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->GetRoutingID(), 486 rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->GetRoutingID(),
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 // Nothing to print, no preview available. 973 // Nothing to print, no preview available.
973 return false; 974 return false;
974 } 975 }
975 DCHECK(tmp_data->size() && tmp_data->front()); 976 DCHECK(tmp_data->size() && tmp_data->front());
976 977
977 *data = tmp_data; 978 *data = tmp_data;
978 *title = print_preview_ui->initiator_tab_title(); 979 *title = print_preview_ui->initiator_tab_title();
979 return true; 980 return true;
980 } 981 }
981 982
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.cc ('k') | chrome/test/base/test_tab_strip_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698