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 "printing/printing_context_win.h" | 5 #include "printing/printing_context_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 DCHECK(!in_print_job_); | 352 DCHECK(!in_print_job_); |
353 settings_.set_device_name(device_name); | 353 settings_.set_device_name(device_name); |
354 PrintSettingsInitializerWin::InitPrintSettings( | 354 PrintSettingsInitializerWin::InitPrintSettings( |
355 context_, *dev_mode, &settings_); | 355 context_, *dev_mode, &settings_); |
356 | 356 |
357 return OK; | 357 return OK; |
358 } | 358 } |
359 | 359 |
360 HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) { | 360 HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) { |
361 HWND window = NULL; | 361 HWND window = NULL; |
362 if (view) | 362 if (view && view->GetHost()) |
363 window = view->GetHost()->GetAcceleratedWidget(); | 363 window = view->GetHost()->GetAcceleratedWidget(); |
364 if (!window) { | 364 if (!window) { |
365 // TODO(maruel): crbug.com/1214347 Get the right browser window instead. | 365 // TODO(maruel): crbug.com/1214347 Get the right browser window instead. |
366 return GetDesktopWindow(); | 366 return GetDesktopWindow(); |
367 } | 367 } |
368 return window; | 368 return window; |
369 } | 369 } |
370 | 370 |
371 scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog( | 371 scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog( |
372 HANDLE printer, | 372 HANDLE printer, |
(...skipping 18 matching lines...) Expand all Loading... |
391 | 391 |
392 if (canceled) { | 392 if (canceled) { |
393 result.reset(); | 393 result.reset(); |
394 abort_printing_ = true; | 394 abort_printing_ = true; |
395 } | 395 } |
396 | 396 |
397 return result.Pass(); | 397 return result.Pass(); |
398 } | 398 } |
399 | 399 |
400 } // namespace printing | 400 } // namespace printing |
OLD | NEW |