OLD | NEW |
---|---|
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 void HandleClosePreviewTab(const ListValue* args); | 73 void HandleClosePreviewTab(const ListValue* args); |
74 | 74 |
75 // Send the printer capabilities to the Web UI. | 75 // Send the printer capabilities to the Web UI. |
76 // |settings_info| contains printer capabilities information. | 76 // |settings_info| contains printer capabilities information. |
77 void SendPrinterCapabilities(const DictionaryValue& settings_info); | 77 void SendPrinterCapabilities(const DictionaryValue& settings_info); |
78 | 78 |
79 // Send the default printer to the Web UI. | 79 // Send the default printer to the Web UI. |
80 void SendDefaultPrinter(const StringValue& default_printer); | 80 void SendDefaultPrinter(const StringValue& default_printer); |
81 | 81 |
82 // Send the list of printers to the Web UI. | 82 // Send the list of printers to the Web UI. |
83 void SendPrinterList(const ListValue& printers, | 83 void SendPrinterList(const ListValue& printers); |
84 const FundamentalValue& default_printer_index); | |
85 | 84 |
86 // Helper function to get the initiator tab for the print preview tab. | 85 // Helper function to get the initiator tab for the print preview tab. |
87 TabContents* GetInitiatorTab(); | 86 TabContents* GetInitiatorTab(); |
88 | 87 |
89 // Helper function to close the print preview tab. | 88 // Helper function to close the print preview tab. |
90 void ClosePrintPreviewTab(); | 89 void ClosePrintPreviewTab(); |
91 | 90 |
92 // Helper function to activate the initiator tab and close the preview tab. | 91 // Helper function to activate the initiator tab and close the preview tab. |
93 void ActivateInitiatorTabAndClosePreviewTab(); | 92 void ActivateInitiatorTabAndClosePreviewTab(); |
94 | 93 |
95 // Adds all the recorded stats taken so far to histogram counts. | 94 // Adds all the recorded stats taken so far to histogram counts. |
96 void ReportStats(); | 95 void ReportStats(); |
97 | 96 |
98 // Pointer to current print system. | 97 // Pointer to current print system. |
99 scoped_refptr<printing::PrintBackend> print_backend_; | 98 scoped_refptr<printing::PrintBackend> print_backend_; |
100 | 99 |
101 // The underlying dialog object. | 100 // The underlying dialog object. |
102 scoped_refptr<SelectFileDialog> select_file_dialog_; | 101 scoped_refptr<SelectFileDialog> select_file_dialog_; |
103 | 102 |
104 static FilePath* last_saved_path_; | 103 static FilePath* last_saved_path_; |
104 static std::string last_used_printer_; | |
Lei Zhang
2011/06/08 00:41:59
I don't think you are allowed to use non-POD stati
dpapad
2011/06/08 16:33:56
Done.
| |
105 | 105 |
106 // A count of how many requests received to regenerate preview data. | 106 // A count of how many requests received to regenerate preview data. |
107 // Initialized to 0 then incremented and emitted to a histogram. | 107 // Initialized to 0 then incremented and emitted to a histogram. |
108 int regenerate_preview_request_count_; | 108 int regenerate_preview_request_count_; |
109 | 109 |
110 // A count of how many requests received to show manage printers dialog. | 110 // A count of how many requests received to show manage printers dialog. |
111 int manage_printers_dialog_request_count_; | 111 int manage_printers_dialog_request_count_; |
112 | 112 |
113 // Whether we have already logged a failed print preview. | 113 // Whether we have already logged a failed print preview. |
114 bool reported_failed_preview_; | 114 bool reported_failed_preview_; |
115 | 115 |
116 // Whether we have already logged the number of printers this session. | 116 // Whether we have already logged the number of printers this session. |
117 bool has_logged_printers_count_; | 117 bool has_logged_printers_count_; |
118 | 118 |
119 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); | 119 DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler); |
120 }; | 120 }; |
121 | 121 |
122 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ | 122 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_HANDLER_H_ |
OLD | NEW |