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

Side by Side Diff: chrome/renderer/mock_printer.h

Issue 9705084: Block printing from blocked popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix init order Created 8 years, 9 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 | « chrome/renderer/chrome_mock_render_thread.cc ('k') | chrome/renderer/mock_printer.cc » ('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 #ifndef CHROME_RENDERER_MOCK_PRINTER_H_ 5 #ifndef CHROME_RENDERER_MOCK_PRINTER_H_
6 #define CHROME_RENDERER_MOCK_PRINTER_H_ 6 #define CHROME_RENDERER_MOCK_PRINTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 PRINTER_PRINTING, 63 PRINTER_PRINTING,
64 PRINTER_ERROR, 64 PRINTER_ERROR,
65 }; 65 };
66 66
67 MockPrinter(); 67 MockPrinter();
68 ~MockPrinter(); 68 ~MockPrinter();
69 69
70 // Functions that changes settings of a pseudo printer. 70 // Functions that changes settings of a pseudo printer.
71 void ResetPrinter(); 71 void ResetPrinter();
72 void SetDefaultPrintSettings(const PrintMsg_Print_Params& params); 72 void SetDefaultPrintSettings(const PrintMsg_Print_Params& params);
73 void SetScriptedPrintAllowed(bool allowed);
73 void UseInvalidSettings(); 74 void UseInvalidSettings();
74 void UseInvalidPageSize(); 75 void UseInvalidPageSize();
75 void UseInvalidContentSize(); 76 void UseInvalidContentSize();
76 77
77 // Functions that handles IPC events. 78 // Functions that handles IPC events.
78 void GetDefaultPrintSettings(PrintMsg_Print_Params* params); 79 void GetDefaultPrintSettings(PrintMsg_Print_Params* params);
80 void OnCheckScriptedPrintAllowed(bool* allowed);
79 void ScriptedPrint(int cookie, 81 void ScriptedPrint(int cookie,
80 int expected_pages_count, 82 int expected_pages_count,
81 bool has_selection, 83 bool has_selection,
82 PrintMsg_PrintPages_Params* settings); 84 PrintMsg_PrintPages_Params* settings);
83 void UpdateSettings(int cookie, PrintMsg_PrintPages_Params* params, 85 void UpdateSettings(int cookie, PrintMsg_PrintPages_Params* params,
84 const std::vector<int>& page_range_array, 86 const std::vector<int>& page_range_array,
85 int margins_type); 87 int margins_type);
86 void SetPrintedPagesCount(int cookie, int number_pages); 88 void SetPrintedPagesCount(int cookie, int number_pages);
87 void PrintPage(const PrintHostMsg_DidPrintPage_Params& params); 89 void PrintPage(const PrintHostMsg_DidPrintPage_Params& params);
88 90
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 bool is_first_request_; 144 bool is_first_request_;
143 bool print_to_pdf_; 145 bool print_to_pdf_;
144 int preview_request_id_; 146 int preview_request_id_;
145 147
146 // Used for displaying headers and footers. 148 // Used for displaying headers and footers.
147 bool display_header_footer_; 149 bool display_header_footer_;
148 string16 date_; 150 string16 date_;
149 string16 title_; 151 string16 title_;
150 string16 url_; 152 string16 url_;
151 153
154 // Used for simulating attempted printing from a blocked popup.
155 bool scripted_print_allowed_;
156
152 // Used for generating invalid settings. 157 // Used for generating invalid settings.
153 bool use_invalid_settings_; 158 bool use_invalid_settings_;
154 159
155 std::vector<scoped_refptr<MockPrinterPage> > pages_; 160 std::vector<scoped_refptr<MockPrinterPage> > pages_;
156 161
157 DISALLOW_COPY_AND_ASSIGN(MockPrinter); 162 DISALLOW_COPY_AND_ASSIGN(MockPrinter);
158 }; 163 };
159 164
160 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ 165 #endif // CHROME_RENDERER_MOCK_PRINTER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_mock_render_thread.cc ('k') | chrome/renderer/mock_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698