diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-12 22:11:33 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-12 22:11:33 +0000 |
commit | 718af82b9cda848d115dc731634ed9378640ace3 (patch) | |
tree | 698bc53413f96071231cad40b1f61ab41bb5fb00 /chrome/renderer/mock_render_thread.h | |
parent | 5a363f218b70bc0f9f5db1ae2fb9e6b1fdcb1978 (diff) | |
download | chromium_src-718af82b9cda848d115dc731634ed9378640ace3.zip chromium_src-718af82b9cda848d115dc731634ed9378640ace3.tar.gz chromium_src-718af82b9cda848d115dc731634ed9378640ace3.tar.bz2 |
Print Preview: Fixing behavior of event listeners.
Now that pending preview requests are being canceled when a new request is issued, the event listeners of the printing controls should not check for |hasPendingPreviewRequest| before issuing new requests, instead they should immediately request a new preview so that the previous one is canceled.
Also all functions that are associated with a specific print request should get the requestID as a parameter, in order to ignore obsolete responses.
I found out that when the print preview tab is reloaded, responses from requests before the reload are reaching the ui code. If reloading the preview tab repeatedly all these request have id=0 and are not being ignored as they should. Therefore I changed the id of the initial request to have a random variable.
BUG=91556, 91769
TEST=See bug description
Review URL: http://codereview.chromium.org/7550022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/mock_render_thread.h')
-rw-r--r-- | chrome/renderer/mock_render_thread.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h index 5eb7ad3..c510d91 100644 --- a/chrome/renderer/mock_render_thread.h +++ b/chrome/renderer/mock_render_thread.h @@ -18,10 +18,11 @@ namespace IPC { class MessageReplyDeserializer; } -struct PrintMsg_Print_Params; -struct PrintMsg_PrintPages_Params; +struct PrintHostMsg_DidGetPreviewPageCount_Params; struct PrintHostMsg_DidPreviewPage_Params; struct PrintHostMsg_ScriptedPrint_Params; +struct PrintMsg_PrintPages_Params; +struct PrintMsg_Print_Params; // This class is very simple mock of RenderThread. It simulates an IPC channel // which supports only two messages: @@ -125,8 +126,8 @@ class MockRenderThread : public RenderThreadBase { void OnDidGetPrintedPagesCount(int cookie, int number_pages); void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); - void OnDidGetPreviewPageCount(int document_cookie, int number_pages, - bool is_modifiable); + void OnDidGetPreviewPageCount( + const PrintHostMsg_DidGetPreviewPageCount_Params& params); void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); // For print preview, PrintWebViewHelper will update settings. |