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

Side by Side Diff: chrome/browser/printing/print_view_manager.cc

Issue 10831272: Adding basic Metro Print Metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding crbug.com Issue ID for TODOs. Created 8 years, 4 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 | « no previous file | printing/printing_context_win.cc » ('j') | printing/printing_context_win.cc » ('J')
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/printing/print_view_manager.h" 5 #include "chrome/browser/printing/print_view_manager.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/metrics/histogram.h"
12 #include "base/timer.h" 13 #include "base/timer.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/printing/print_error_dialog.h" 16 #include "chrome/browser/printing/print_error_dialog.h"
16 #include "chrome/browser/printing/print_job.h" 17 #include "chrome/browser/printing/print_job.h"
17 #include "chrome/browser/printing/print_job_manager.h" 18 #include "chrome/browser/printing/print_job_manager.h"
18 #include "chrome/browser/printing/print_preview_tab_controller.h" 19 #include "chrome/browser/printing/print_preview_tab_controller.h"
19 #include "chrome/browser/printing/print_view_manager_observer.h" 20 #include "chrome/browser/printing/print_view_manager_observer.h"
20 #include "chrome/browser/printing/printer_query.h" 21 #include "chrome/browser/printing/printer_query.h"
21 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( 103 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
103 print_preview_tab->web_contents()->GetWebUI()->GetController()); 104 print_preview_tab->web_contents()->GetWebUI()->GetController());
104 print_preview_ui->OnShowSystemDialog(); 105 print_preview_ui->OnShowSystemDialog();
105 return true; 106 return true;
106 } else { 107 } else {
107 return PrintNow(); 108 return PrintNow();
108 } 109 }
109 } 110 }
110 111
111 bool PrintViewManager::PrintToDestination() { 112 bool PrintViewManager::PrintToDestination() {
113 // TODO(mad): Remove this once we can send user metrics from the metro driver.
114 // crbug.com/142330
115 UMA_HISTOGRAM_ENUMERATION("Metro.Print", 0, 2);
Ilya Sherman 2012/08/13 22:34:00 nit: Please use named constants from an enum rathe
112 // TODO(mad): Use a passed in destination interface instead. 116 // TODO(mad): Use a passed in destination interface instead.
113 g_browser_process->print_job_manager()->SetPrintDestination( 117 g_browser_process->print_job_manager()->SetPrintDestination(
114 printing::CreatePrintDestination()); 118 printing::CreatePrintDestination());
115 return PrintNowInternal(new PrintMsg_PrintPages(routing_id())); 119 return PrintNowInternal(new PrintMsg_PrintPages(routing_id()));
116 } 120 }
117 121
118 bool PrintViewManager::PrintPreviewNow() { 122 bool PrintViewManager::PrintPreviewNow() {
119 if (print_preview_state_ != NOT_PREVIEWING) { 123 if (print_preview_state_ != NOT_PREVIEWING) {
120 NOTREACHED(); 124 NOTREACHED();
121 return false; 125 return false;
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 scoped_refptr<printing::PrinterQuery> printer_query; 655 scoped_refptr<printing::PrinterQuery> printer_query;
652 print_job_manager->PopPrinterQuery(cookie, &printer_query); 656 print_job_manager->PopPrinterQuery(cookie, &printer_query);
653 if (!printer_query.get()) 657 if (!printer_query.get())
654 return; 658 return;
655 BrowserThread::PostTask( 659 BrowserThread::PostTask(
656 BrowserThread::IO, FROM_HERE, 660 BrowserThread::IO, FROM_HERE,
657 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); 661 base::Bind(&PrinterQuery::StopWorker, printer_query.get()));
658 } 662 }
659 663
660 } // namespace printing 664 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | printing/printing_context_win.cc » ('j') | printing/printing_context_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698