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 "printing/printing_context_win.h" | 5 #include "printing/printing_context_win.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 : PrintingContext(app_locale), | 190 : PrintingContext(app_locale), |
191 context_(NULL), | 191 context_(NULL), |
192 dialog_box_(NULL), | 192 dialog_box_(NULL), |
193 print_dialog_func_(&PrintDlgEx) { | 193 print_dialog_func_(&PrintDlgEx) { |
194 } | 194 } |
195 | 195 |
196 PrintingContextWin::~PrintingContextWin() { | 196 PrintingContextWin::~PrintingContextWin() { |
197 ReleaseContext(); | 197 ReleaseContext(); |
198 } | 198 } |
199 | 199 |
200 void PrintingContextWin::AskUserForSettings(HWND view, | 200 void PrintingContextWin::AskUserForSettings(gfx::NativeView view, |
201 int max_pages, | 201 int max_pages, |
202 bool has_selection, | 202 bool has_selection, |
203 PrintSettingsCallback* callback) { | 203 PrintSettingsCallback* callback) { |
204 DCHECK(!in_print_job_); | 204 DCHECK(!in_print_job_); |
205 dialog_box_dismissed_ = false; | 205 dialog_box_dismissed_ = false; |
206 | 206 |
207 HWND window; | 207 HWND window; |
208 if (!view || !IsWindow(view)) { | 208 if (!view || !IsWindow(view)) { |
209 // TODO(maruel): bug 1214347 Get the right browser window instead. | 209 // TODO(maruel): bug 1214347 Get the right browser window instead. |
210 window = GetDesktopWindow(); | 210 window = GetDesktopWindow(); |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 if (buf_size) { | 760 if (buf_size) { |
761 buffer->reset(new uint8[buf_size]); | 761 buffer->reset(new uint8[buf_size]); |
762 memset(buffer->get(), 0, buf_size); | 762 memset(buffer->get(), 0, buf_size); |
763 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { | 763 if (!GetPrinter(printer, level, buffer->get(), buf_size, &buf_size)) { |
764 buffer->reset(); | 764 buffer->reset(); |
765 } | 765 } |
766 } | 766 } |
767 } | 767 } |
768 | 768 |
769 } // namespace printing | 769 } // namespace printing |
OLD | NEW |