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

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

Issue 384983002: Count external PDF viewer usage in print preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 07/10/2014 16:03:32.64 Created 6 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 PORTRAIT, 111 PORTRAIT,
112 COLOR, 112 COLOR,
113 BLACK_AND_WHITE, 113 BLACK_AND_WHITE,
114 COLLATE, 114 COLLATE,
115 SIMPLEX, 115 SIMPLEX,
116 DUPLEX, 116 DUPLEX,
117 TOTAL, 117 TOTAL,
118 HEADERS_AND_FOOTERS, 118 HEADERS_AND_FOOTERS,
119 CSS_BACKGROUND, 119 CSS_BACKGROUND,
120 SELECTION_ONLY, 120 SELECTION_ONLY,
121 EXTERNAL_PDF_PREVIEW,
121 PRINT_SETTINGS_BUCKET_BOUNDARY 122 PRINT_SETTINGS_BUCKET_BOUNDARY
122 }; 123 };
123 124
124 enum UiBucketGroups { 125 enum UiBucketGroups {
125 DESTINATION_SEARCH, 126 DESTINATION_SEARCH,
126 GCP_PROMO, 127 GCP_PROMO,
127 UI_BUCKET_GROUP_BOUNDARY 128 UI_BUCKET_GROUP_BOUNDARY
128 }; 129 };
129 130
130 enum PrintDestinationBuckets { 131 enum PrintDestinationBuckets {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 if (settings.GetBoolean(printing::kSettingShouldPrintBackgrounds, 255 if (settings.GetBoolean(printing::kSettingShouldPrintBackgrounds,
255 &css_background) && css_background) { 256 &css_background) && css_background) {
256 ReportPrintSettingHistogram(CSS_BACKGROUND); 257 ReportPrintSettingHistogram(CSS_BACKGROUND);
257 } 258 }
258 259
259 bool selection_only = false; 260 bool selection_only = false;
260 if (settings.GetBoolean(printing::kSettingShouldPrintSelectionOnly, 261 if (settings.GetBoolean(printing::kSettingShouldPrintSelectionOnly,
261 &selection_only) && selection_only) { 262 &selection_only) && selection_only) {
262 ReportPrintSettingHistogram(SELECTION_ONLY); 263 ReportPrintSettingHistogram(SELECTION_ONLY);
263 } 264 }
265
266 bool external_preview = false;
267 if (settings.GetBoolean(printing::kSettingOpenPDFInPreview,
268 &external_preview) && external_preview) {
269 ReportPrintSettingHistogram(EXTERNAL_PDF_PREVIEW);
270 }
264 } 271 }
265 272
266 // Callback that stores a PDF file on disk. 273 // Callback that stores a PDF file on disk.
267 void PrintToPdfCallback(printing::Metafile* metafile, 274 void PrintToPdfCallback(printing::Metafile* metafile,
268 const base::FilePath& path) { 275 const base::FilePath& path) {
269 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 276 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
270 metafile->SaveTo(path); 277 metafile->SaveTo(path);
271 // |metafile| must be deleted on the UI thread. 278 // |metafile| must be deleted on the UI thread.
272 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, metafile); 279 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, metafile);
273 } 280 }
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 reconcilor_ = AccountReconcilorFactory::GetForProfile(profile); 1614 reconcilor_ = AccountReconcilorFactory::GetForProfile(profile);
1608 if (reconcilor_) 1615 if (reconcilor_)
1609 reconcilor_->AddMergeSessionObserver(this); 1616 reconcilor_->AddMergeSessionObserver(this);
1610 } 1617 }
1611 } 1618 }
1612 1619
1613 void PrintPreviewHandler::UnregisterForMergeSession() { 1620 void PrintPreviewHandler::UnregisterForMergeSession() {
1614 if (reconcilor_) 1621 if (reconcilor_)
1615 reconcilor_->RemoveMergeSessionObserver(this); 1622 reconcilor_->RemoveMergeSessionObserver(this);
1616 } 1623 }
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698