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

Unified Diff: chrome/common/render_messages.h

Issue 118338: Add support for printing selection only flag. This only adds the flag to the ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/render_messages.h
===================================================================
--- chrome/common/render_messages.h (revision 17852)
+++ chrome/common/render_messages.h (working copy)
@@ -291,19 +291,23 @@
// 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 @@
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 @@
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>");
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698