| Index: printing/printing_context_win.cc
|
| diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
|
| index 3e4e6e9396e1dd8a7355285791ae9cfbf5b26b9b..42ebb1aa0f8ee545e19e7927e7e560975756b403 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): crbug.com/1214347 Get the right browser window instead.
|
| + return GetDesktopWindow();
|
| + }
|
| + return window;
|
| +}
|
| +
|
| scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog(
|
| HANDLE printer,
|
| gfx::NativeView parent_view,
|
|
|