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 480303002: Use document from preview for System Dialog printing on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue Aug 26 01:11:31 PDT 2014 Created 6 years, 3 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
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 // Nothing to print, no preview available. 825 // Nothing to print, no preview available.
826 return; 826 return;
827 } 827 }
828 828
829 if (is_cloud_printer) { 829 if (is_cloud_printer) {
830 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintToCloudPrint", 830 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintToCloudPrint",
831 page_count); 831 page_count);
832 ReportUserActionHistogram(PRINT_WITH_CLOUD_PRINT); 832 ReportUserActionHistogram(PRINT_WITH_CLOUD_PRINT);
833 SendCloudPrintJob(data.get()); 833 SendCloudPrintJob(data.get());
834 } else { 834 } else {
835 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintToPrinter", page_count); 835 bool system_dialog = false;
836 ReportUserActionHistogram(PRINT_TO_PRINTER); 836 settings->GetBoolean(printing::kSettingShowSystemDialog, &system_dialog);
837 if (system_dialog) {
838 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.SystemDialog", page_count);
839 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG);
840 } else {
841 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintToPrinter", page_count);
842 ReportUserActionHistogram(PRINT_TO_PRINTER);
843 }
837 ReportPrintSettingsStats(*settings); 844 ReportPrintSettingsStats(*settings);
838 845
839 // This tries to activate the initiator as well, so do not clear the 846 // This tries to activate the initiator as well, so do not clear the
840 // association with the initiator yet. 847 // association with the initiator yet.
841 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( 848 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
842 web_ui()->GetController()); 849 web_ui()->GetController());
843 print_preview_ui->OnHidePreviewDialog(); 850 print_preview_ui->OnHidePreviewDialog();
844 851
845 // Do this so the initiator can open a new print preview dialog, while the 852 // Do this so the initiator can open a new print preview dialog, while the
846 // current print preview dialog is still handling its print job. 853 // current print preview dialog is still handling its print job.
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 1582
1576 void PrintPreviewHandler::UnregisterForMergeSession() { 1583 void PrintPreviewHandler::UnregisterForMergeSession() {
1577 if (reconcilor_) 1584 if (reconcilor_)
1578 reconcilor_->RemoveMergeSessionObserver(this); 1585 reconcilor_->RemoveMergeSessionObserver(this);
1579 } 1586 }
1580 1587
1581 void PrintPreviewHandler::SetPdfSavedClosureForTesting( 1588 void PrintPreviewHandler::SetPdfSavedClosureForTesting(
1582 const base::Closure& closure) { 1589 const base::Closure& closure) {
1583 pdf_file_saved_closure_ = closure; 1590 pdf_file_saved_closure_ = closure;
1584 } 1591 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.js ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698