Chromium Code Reviews

Side by Side Diff: chrome/renderer/chrome_mock_render_thread.cc

Issue 480303002: Use document from preview for System Dialog printing on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue 08/19/2014 11:17:57.84 Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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/renderer/chrome_mock_render_thread.h" 5 #include "chrome/renderer/chrome_mock_render_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/renderer/printing/mock_printer.h" 10 #include "chrome/renderer/printing/mock_printer.h"
(...skipping 142 matching lines...)
153 } 153 }
154 154
155 void ChromeMockRenderThread::OnCheckForCancel(int32 preview_ui_id, 155 void ChromeMockRenderThread::OnCheckForCancel(int32 preview_ui_id,
156 int preview_request_id, 156 int preview_request_id,
157 bool* cancel) { 157 bool* cancel) {
158 *cancel = 158 *cancel =
159 (print_preview_pages_remaining_ == print_preview_cancel_page_number_); 159 (print_preview_pages_remaining_ == print_preview_cancel_page_number_);
160 } 160 }
161 161
162 void ChromeMockRenderThread::OnUpdatePrintSettings( 162 void ChromeMockRenderThread::OnUpdatePrintSettings(
163 int render_view_id,
163 int document_cookie, 164 int document_cookie,
164 const base::DictionaryValue& job_settings, 165 const base::DictionaryValue& job_settings,
165 PrintMsg_PrintPages_Params* params) { 166 PrintMsg_PrintPages_Params* params,
167 bool* canceled) {
168 if (canceled)
169 *canceled = false;
166 // Check and make sure the required settings are all there. 170 // Check and make sure the required settings are all there.
167 // We don't actually care about the values. 171 // We don't actually care about the values.
168 std::string dummy_string; 172 std::string dummy_string;
169 int margins_type = 0; 173 int margins_type = 0;
170 if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) || 174 if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) ||
171 !job_settings.GetBoolean(printing::kSettingCollate, NULL) || 175 !job_settings.GetBoolean(printing::kSettingCollate, NULL) ||
172 !job_settings.GetInteger(printing::kSettingColor, NULL) || 176 !job_settings.GetInteger(printing::kSettingColor, NULL) ||
173 !job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) || 177 !job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) ||
174 !job_settings.GetBoolean(printing::kIsFirstRequest, NULL) || 178 !job_settings.GetBoolean(printing::kIsFirstRequest, NULL) ||
175 !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) || 179 !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) ||
(...skipping 43 matching lines...)
219 } 223 }
220 224
221 void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) { 225 void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) {
222 print_preview_cancel_page_number_ = page; 226 print_preview_cancel_page_number_ = page;
223 } 227 }
224 228
225 int ChromeMockRenderThread::print_preview_pages_remaining() const { 229 int ChromeMockRenderThread::print_preview_pages_remaining() const {
226 return print_preview_pages_remaining_; 230 return print_preview_pages_remaining_;
227 } 231 }
228 #endif // defined(ENABLE_PRINTING) 232 #endif // defined(ENABLE_PRINTING)
OLDNEW

Powered by Google App Engine