diff options
author | sverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 17:05:21 +0000 |
---|---|---|
committer | sverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 17:05:21 +0000 |
commit | c8ad40c6b02751c1cc942abe4ecaffbf68bfa611 (patch) | |
tree | d34b6d63f8a66fb06c3f87ce1914eefb755cf441 /chrome/common/render_messages.h | |
parent | a91d541c58ad5e3b46309ee279bc569734a22564 (diff) | |
download | chromium_src-c8ad40c6b02751c1cc942abe4ecaffbf68bfa611.zip chromium_src-c8ad40c6b02751c1cc942abe4ecaffbf68bfa611.tar.gz chromium_src-c8ad40c6b02751c1cc942abe4ecaffbf68bfa611.tar.bz2 |
Add support for printing selection only flag. This only adds the flag to the IPC and implements the Windows dialog interaction but does not enable this just yet.
BUG=http://crbug.com/1682
TEST=none
Review URL: http://codereview.chromium.org/118338
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/render_messages.h')
-rw-r--r-- | chrome/common/render_messages.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 76341c5..4f10abf 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -291,19 +291,23 @@ struct ViewMsg_Print_Params { // Cookie for the document to ensure correctness. int document_cookie; + // Should only print currently selected text. + bool selection_only; + // Warning: do not compare document_cookie. bool Equals(const ViewMsg_Print_Params& rhs) const { return printable_size == rhs.printable_size && dpi == rhs.dpi && min_shrink == rhs.min_shrink && max_shrink == rhs.max_shrink && - desired_dpi == rhs.desired_dpi; + desired_dpi == rhs.desired_dpi && + selection_only == rhs.selection_only; } // Checking if the current params is empty. Just initialized after a memset. bool IsEmpty() const { return !document_cookie && !desired_dpi && !max_shrink && !min_shrink && - !dpi && printable_size.IsEmpty(); + !dpi && printable_size.IsEmpty() && !selection_only; } }; @@ -1426,6 +1430,7 @@ struct ParamTraits<ViewMsg_Print_Params> { WriteParam(m, p.max_shrink); WriteParam(m, p.desired_dpi); WriteParam(m, p.document_cookie); + WriteParam(m, p.selection_only); } static bool Read(const Message* m, void** iter, param_type* p) { return ReadParam(m, iter, &p->printable_size) && @@ -1433,7 +1438,8 @@ struct ParamTraits<ViewMsg_Print_Params> { ReadParam(m, iter, &p->min_shrink) && ReadParam(m, iter, &p->max_shrink) && ReadParam(m, iter, &p->desired_dpi) && - ReadParam(m, iter, &p->document_cookie); + ReadParam(m, iter, &p->document_cookie) && + ReadParam(m, iter, &p->selection_only); } static void Log(const param_type& p, std::wstring* l) { l->append(L"<ViewMsg_Print_Params>"); |