Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: printing/printing_context_win.cc

Issue 557663002: Restored printing windows context for builds without preview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mon Sep 8 23:36:56 PDT 2014 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/printing_context_win.h ('k') | printing/printing_context_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « printing/printing_context_win.h ('k') | printing/printing_context_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698