summaryrefslogtreecommitdiffstats
path: root/printing/printing_context_win.cc
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 19:26:40 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 19:26:40 +0000
commitfc790462b4f248712bbc8c3734664dd6b05f80f2 (patch)
tree4ef04b11c6620ac2c95fb3f87e0d722e7bbcd1ee /printing/printing_context_win.cc
parent1d0ee423b6a0bb307c7c19fe28c95d8761691e9a (diff)
downloadchromium_src-fc790462b4f248712bbc8c3734664dd6b05f80f2.zip
chromium_src-fc790462b4f248712bbc8c3734664dd6b05f80f2.tar.gz
chromium_src-fc790462b4f248712bbc8c3734664dd6b05f80f2.tar.bz2
Set the job name for the print job on the Mac.
BUG=http://crbug.com/29188 TEST=as in bug Review URL: http://codereview.chromium.org/1997016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/printing_context_win.cc')
-rw-r--r--printing/printing_context_win.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index 2142b0f..6215cd4 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -152,12 +152,21 @@ PrintingContext::~PrintingContext() {
}
PrintingContext::Result PrintingContext::AskUserForSettings(
- HWND window,
+ HWND view,
int max_pages,
bool has_selection) {
- DCHECK(window);
DCHECK(!in_print_job_);
dialog_box_dismissed_ = false;
+
+ HWND window;
+ if (!view || !IsWindow(view)) {
+ // TODO(maruel): bug 1214347 Get the right browser window instead.
+ window = GetDesktopWindow();
+ } else {
+ window = GetAncestor(view, GA_ROOTOWNER);
+ }
+ DCHECK(window);
+
// Show the OS-dependent dialog box.
// If the user press
// - OK, the settings are reset and reinitialized with the new settings. OK is