| 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 #include "chrome/renderer/mock_render_thread.h" | 5 #include "chrome/renderer/mock_render_thread.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void MockRenderThread::OnUpdatePrintSettings( | 235 void MockRenderThread::OnUpdatePrintSettings( |
| 236 int document_cookie, | 236 int document_cookie, |
| 237 const DictionaryValue& job_settings, | 237 const DictionaryValue& job_settings, |
| 238 PrintMsg_PrintPages_Params* params) { | 238 PrintMsg_PrintPages_Params* params) { |
| 239 // Check and make sure the required settings are all there. | 239 // Check and make sure the required settings are all there. |
| 240 // We don't actually care about the values. | 240 // We don't actually care about the values. |
| 241 std::string dummy_string; | 241 std::string dummy_string; |
| 242 if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) || | 242 if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) || |
| 243 !job_settings.GetBoolean(printing::kSettingCollate, NULL) || | 243 !job_settings.GetBoolean(printing::kSettingCollate, NULL) || |
| 244 !job_settings.GetBoolean(printing::kSettingColor, NULL) || | 244 !job_settings.GetBoolean(printing::kSettingColor, NULL) || |
| 245 !job_settings.GetDictionary(printing::kSettingDuplexModeInfo, NULL) || |
| 245 !job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) || | 246 !job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) || |
| 246 !job_settings.GetBoolean(printing::kIsFirstRequest, NULL) || | 247 !job_settings.GetBoolean(printing::kIsFirstRequest, NULL) || |
| 247 !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) || | 248 !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) || |
| 248 !job_settings.GetInteger(printing::kSettingDuplexMode, NULL) || | |
| 249 !job_settings.GetInteger(printing::kSettingCopies, NULL) || | 249 !job_settings.GetInteger(printing::kSettingCopies, NULL) || |
| 250 !job_settings.GetString(printing::kPreviewUIAddr, &dummy_string) || | 250 !job_settings.GetString(printing::kPreviewUIAddr, &dummy_string) || |
| 251 !job_settings.GetInteger(printing::kPreviewRequestID, NULL)) { | 251 !job_settings.GetInteger(printing::kPreviewRequestID, NULL)) { |
| 252 return; | 252 return; |
| 253 } | 253 } |
| 254 | 254 |
| 255 // Just return the default settings. | 255 // Just return the default settings. |
| 256 if (printer_.get()) { | 256 if (printer_.get()) { |
| 257 ListValue* page_range_array; | 257 ListValue* page_range_array; |
| 258 printing::PageRanges new_ranges; | 258 printing::PageRanges new_ranges; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 282 print_dialog_user_response_ = response; | 282 print_dialog_user_response_ = response; |
| 283 } | 283 } |
| 284 | 284 |
| 285 void MockRenderThread::set_print_preview_cancel_page_number(int page) { | 285 void MockRenderThread::set_print_preview_cancel_page_number(int page) { |
| 286 print_preview_cancel_page_number_ = page; | 286 print_preview_cancel_page_number_ = page; |
| 287 } | 287 } |
| 288 | 288 |
| 289 int MockRenderThread::print_preview_pages_remaining() { | 289 int MockRenderThread::print_preview_pages_remaining() { |
| 290 return print_preview_pages_remaining_; | 290 return print_preview_pages_remaining_; |
| 291 } | 291 } |
| OLD | NEW |