| OLD | NEW |
| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 document_cookie, | 163 int document_cookie, |
| 164 const base::DictionaryValue& job_settings, | 164 const base::DictionaryValue& job_settings, |
| 165 PrintMsg_PrintPages_Params* params) { | 165 PrintMsg_PrintPages_Params* params, |
| 166 bool* canceled) { |
| 167 if (canceled) |
| 168 *canceled = false; |
| 166 // Check and make sure the required settings are all there. | 169 // Check and make sure the required settings are all there. |
| 167 // We don't actually care about the values. | 170 // We don't actually care about the values. |
| 168 std::string dummy_string; | 171 std::string dummy_string; |
| 169 int margins_type = 0; | 172 int margins_type = 0; |
| 170 if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) || | 173 if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) || |
| 171 !job_settings.GetBoolean(printing::kSettingCollate, NULL) || | 174 !job_settings.GetBoolean(printing::kSettingCollate, NULL) || |
| 172 !job_settings.GetInteger(printing::kSettingColor, NULL) || | 175 !job_settings.GetInteger(printing::kSettingColor, NULL) || |
| 173 !job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) || | 176 !job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) || |
| 174 !job_settings.GetBoolean(printing::kIsFirstRequest, NULL) || | 177 !job_settings.GetBoolean(printing::kIsFirstRequest, NULL) || |
| 175 !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) || | 178 !job_settings.GetString(printing::kSettingDeviceName, &dummy_string) || |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 222 } |
| 220 | 223 |
| 221 void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) { | 224 void ChromeMockRenderThread::set_print_preview_cancel_page_number(int page) { |
| 222 print_preview_cancel_page_number_ = page; | 225 print_preview_cancel_page_number_ = page; |
| 223 } | 226 } |
| 224 | 227 |
| 225 int ChromeMockRenderThread::print_preview_pages_remaining() const { | 228 int ChromeMockRenderThread::print_preview_pages_remaining() const { |
| 226 return print_preview_pages_remaining_; | 229 return print_preview_pages_remaining_; |
| 227 } | 230 } |
| 228 #endif // defined(ENABLE_PRINTING) | 231 #endif // defined(ENABLE_PRINTING) |
| OLD | NEW |