summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
Diffstat (limited to 'printing')
-rw-r--r--printing/printing_context.h6
-rw-r--r--printing/printing_context_cairo.cc11
-rw-r--r--printing/printing_context_cairo.h1
-rw-r--r--printing/printing_context_mac.h3
-rw-r--r--printing/printing_context_mac.mm15
-rw-r--r--printing/printing_context_win.cc11
-rw-r--r--printing/printing_context_win.h3
7 files changed, 46 insertions, 4 deletions
diff --git a/printing/printing_context.h b/printing/printing_context.h
index 6d51f02..d7d5016 100644
--- a/printing/printing_context.h
+++ b/printing/printing_context.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -47,6 +47,10 @@ class PrintingContext {
// default device settings.
virtual Result UseDefaultSettings() = 0;
+ // Update print settings. As of now we are updating the page range settings.
+ // In the future, update other print job settings.
+ virtual Result UpdatePrintSettings(const PageRanges& ranges) = 0;
+
// Initializes with predefined settings.
virtual Result InitWithSettings(const PrintSettings& settings) = 0;
diff --git a/printing/printing_context_cairo.cc b/printing/printing_context_cairo.cc
index 84aaa64..c8b0ef3 100644
--- a/printing/printing_context_cairo.cc
+++ b/printing/printing_context_cairo.cc
@@ -151,6 +151,17 @@ PrintingContext::Result PrintingContextCairo::UseDefaultSettings() {
return OK;
}
+PrintingContext::Result PrintingContextCairo::UpdatePrintSettings(
+ const PageRanges& ranges) {
+ DCHECK(!in_print_job_);
+
+ settings_.ranges = ranges;
+
+ NOTIMPLEMENTED();
+
+ return FAILED;
+}
+
PrintingContext::Result PrintingContextCairo::InitWithSettings(
const PrintSettings& settings) {
DCHECK(!in_print_job_);
diff --git a/printing/printing_context_cairo.h b/printing/printing_context_cairo.h
index 9a88eae..514b341 100644
--- a/printing/printing_context_cairo.h
+++ b/printing/printing_context_cairo.h
@@ -40,6 +40,7 @@ class PrintingContextCairo : public PrintingContext {
bool has_selection,
PrintSettingsCallback* callback);
virtual Result UseDefaultSettings();
+ virtual Result UpdatePrintSettings(const PageRanges& ranges);
virtual Result InitWithSettings(const PrintSettings& settings);
virtual Result NewDocument(const string16& document_name);
virtual Result NewPage();
diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h
index 8f6bf34..b709460 100644
--- a/printing/printing_context_mac.h
+++ b/printing/printing_context_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,6 +28,7 @@ class PrintingContextMac : public PrintingContext {
bool has_selection,
PrintSettingsCallback* callback);
virtual Result UseDefaultSettings();
+ virtual Result UpdatePrintSettings(const PageRanges& ranges);
virtual Result InitWithSettings(const PrintSettings& settings);
virtual Result NewDocument(const string16& document_name);
virtual Result NewPage();
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index 1826c49..575875d 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -80,6 +80,19 @@ PrintingContext::Result PrintingContextMac::UseDefaultSettings() {
return OK;
}
+PrintingContext::Result PrintingContextMac::UpdatePrintSettings(
+ const PageRanges& ranges) {
+ DCHECK(!in_print_job_);
+
+ // TODO (kmadhusu): Update other print job settings such as number of copies,
+ // collate, etc.,
+
+ // Update the print range information.
+ settings_.ranges = ranges;
+
+ return OK;
+}
+
void PrintingContextMac::ParsePrintInfo(NSPrintInfo* print_info) {
ResetSettings();
print_info_ = [print_info retain];
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index 3d40739..467bf3c 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -208,6 +208,17 @@ PrintingContext::Result PrintingContextWin::UseDefaultSettings() {
return ParseDialogResult(dialog_options);
}
+PrintingContext::Result PrintingContextWin::UpdatePrintSettings(
+ const PageRanges& ranges) {
+ DCHECK(!in_print_job_);
+
+ settings_.ranges = ranges;
+
+ NOTIMPLEMENTED();
+
+ return FAILED;
+}
+
PrintingContext::Result PrintingContextWin::InitWithSettings(
const PrintSettings& settings) {
DCHECK(!in_print_job_);
diff --git a/printing/printing_context_win.h b/printing/printing_context_win.h
index d42bf97..4037536 100644
--- a/printing/printing_context_win.h
+++ b/printing/printing_context_win.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,6 +28,7 @@ class PrintingContextWin : public PrintingContext {
bool has_selection,
PrintSettingsCallback* callback);
virtual Result UseDefaultSettings();
+ virtual Result UpdatePrintSettings(const PageRanges& ranges);
virtual Result InitWithSettings(const PrintSettings& settings);
virtual Result NewDocument(const string16& document_name);
virtual Result NewPage();