Chromium Code Reviews| Index: printing/printing_context_win.cc |
| diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc |
| index 3e4e6e9396e1dd8a7355285791ae9cfbf5b26b9b..8813845332f466b847ef2b7f264bfeeaf845fa15 100644 |
| --- a/printing/printing_context_win.cc |
| +++ b/printing/printing_context_win.cc |
| @@ -12,6 +12,7 @@ |
| #include "printing/backend/win_helper.h" |
| #include "printing/print_settings_initializer_win.h" |
| #include "printing/printed_document.h" |
| +#include "printing/printing_context_system_dialog_win.h" |
| #include "printing/printing_utils.h" |
| #include "printing/units.h" |
| #include "skia/ext/platform_device.h" |
| @@ -21,32 +22,16 @@ |
| #include "ui/aura/window.h" |
| #endif |
| -namespace { |
| - |
| -HWND GetRootWindow(gfx::NativeView view) { |
| - HWND window = NULL; |
| -#if defined(USE_AURA) |
| - if (view) |
| - window = view->GetHost()->GetAcceleratedWidget(); |
| -#else |
| - if (view && IsWindow(view)) { |
| - window = GetAncestor(view, GA_ROOTOWNER); |
| - } |
| -#endif |
| - if (!window) { |
| - // TODO(maruel): bug 1214347 Get the right browser window instead. |
| - return GetDesktopWindow(); |
| - } |
| - return window; |
| -} |
| - |
| -} // anonymous namespace |
| - |
| namespace printing { |
| // static |
| scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { |
| +#if defined(DISABLE_BASIC_PRINTING) |
| return make_scoped_ptr<PrintingContext>(new PrintingContextWin(delegate)); |
| +#else // DISABLE_BASIC_PRINTING |
| + return make_scoped_ptr<PrintingContext>( |
| + new PrintingContextSytemDialogWin(delegate)); |
| +#endif // DISABLE_BASIC_PRINTING |
| } |
| PrintingContextWin::PrintingContextWin(Delegate* delegate) |
| @@ -364,6 +349,23 @@ PrintingContext::Result PrintingContextWin::InitializeSettings( |
| return OK; |
| } |
| +HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) { |
| + HWND window = NULL; |
| +#if defined(USE_AURA) |
| + if (view) |
| + window = view->GetHost()->GetAcceleratedWidget(); |
| +#else |
| + if (view && IsWindow(view)) { |
| + window = GetAncestor(view, GA_ROOTOWNER); |
| + } |
| +#endif |
| + if (!window) { |
| + // TODO(maruel): bug 1214347 Get the right browser window instead. |
|
Noam Samuel
2014/09/09 18:49:54
nit: crbug url?
Vitaly Buka (NO REVIEWS)
2014/09/09 19:14:48
Done.
|
| + return GetDesktopWindow(); |
| + } |
| + return window; |
| +} |
| + |
| scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog( |
| HANDLE printer, |
| gfx::NativeView parent_view, |