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

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

Issue 7056070: PrintPreview: Preview generation should not block print button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 6 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 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void HandleGetPrinters(const ListValue* args); 49 void HandleGetPrinters(const ListValue* args);
50 50
51 // Ask the initiator renderer to generate a preview. 51 // Ask the initiator renderer to generate a preview.
52 // First element of |args| is a job settings JSON string. 52 // First element of |args| is a job settings JSON string.
53 void HandleGetPreview(const ListValue* args); 53 void HandleGetPreview(const ListValue* args);
54 54
55 // Get the job settings from Web UI and initiate printing. 55 // Get the job settings from Web UI and initiate printing.
56 // First element of |args| is a job settings JSON string. 56 // First element of |args| is a job settings JSON string.
57 void HandlePrint(const ListValue* args); 57 void HandlePrint(const ListValue* args);
58 58
59 // Handles the request to hide the preview tab for printing.
60 // |args| is unused.
61 void HandleHidePreview(const ListValue* args);
62
59 // Get the printer capabilities. 63 // Get the printer capabilities.
60 // First element of |args| is the printer name. 64 // First element of |args| is the printer name.
61 void HandleGetPrinterCapabilities(const ListValue* args); 65 void HandleGetPrinterCapabilities(const ListValue* args);
62 66
63 // Ask the initiator renderer to show the native print system dialog. 67 // Ask the initiator renderer to show the native print system dialog.
64 // |args| is unused. 68 // |args| is unused.
65 void HandleShowSystemDialog(const ListValue* args); 69 void HandleShowSystemDialog(const ListValue* args);
66 70
67 // Ask the browser to show the native printer management dialog. 71 // Ask the browser to show the native printer management dialog.
68 // |args| is unused. 72 // |args| is unused.
(...skipping 19 matching lines...) Expand all
88 92
89 // Helper function to close the print preview tab. 93 // Helper function to close the print preview tab.
90 void ClosePrintPreviewTab(); 94 void ClosePrintPreviewTab();
91 95
92 // Helper function to activate the initiator tab and close the preview tab. 96 // Helper function to activate the initiator tab and close the preview tab.
93 void ActivateInitiatorTabAndClosePreviewTab(); 97 void ActivateInitiatorTabAndClosePreviewTab();
94 98
95 // Adds all the recorded stats taken so far to histogram counts. 99 // Adds all the recorded stats taken so far to histogram counts.
96 void ReportStats(); 100 void ReportStats();
97 101
102 // Helper function to hide the preview tab for printing.
103 void HidePreviewTab();
104
105 // Helper function to clear initiator tab details for this preview tab.
106 void ClearInitiatorTabDetails();
107
98 // Pointer to current print system. 108 // Pointer to current print system.
99 scoped_refptr<printing::PrintBackend> print_backend_; 109 scoped_refptr<printing::PrintBackend> print_backend_;
100 110
101 // The underlying dialog object. 111 // The underlying dialog object.
102 scoped_refptr<SelectFileDialog> select_file_dialog_; 112 scoped_refptr<SelectFileDialog> select_file_dialog_;
103 113
104 static FilePath* last_saved_path_; 114 static FilePath* last_saved_path_;
105 115
106 // A count of how many requests received to regenerate preview data. 116 // A count of how many requests received to regenerate preview data.
107 // Initialized to 0 then incremented and emitted to a histogram. 117 // Initialized to 0 then incremented and emitted to a histogram.
108 int regenerate_preview_request_count_; 118 int regenerate_preview_request_count_;
109 119
110 // A count of how many requests received to show manage printers dialog. 120 // A count of how many requests received to show manage printers dialog.
111 int manage_printers_dialog_request_count_; 121 int manage_printers_dialog_request_count_;
112 122
113 // Whether we have already logged a failed print preview. 123 // Whether we have already logged a failed print preview.
114 bool reported_failed_preview_; 124 bool reported_failed_preview_;
115 125
116 // Whether we have already logged the number of printers this session. 126 // Whether we have already logged the number of printers this session.
117 bool has_logged_printers_count_; 127 bool has_logged_printers_count_;
118 128
119 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); 129 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
120 }; 130 };
121 131
122 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ 132 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698