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

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

Issue 7042034: Print Preview: Remembering last used printer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_;
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_
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview.js ('k') | chrome/browser/ui/webui/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698