summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/mock_render_thread.cc
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-11 17:44:19 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-11 17:44:19 +0000
commit81ac4a3fd428d19ec78072b8614a354cf0cc5c18 (patch)
tree8163015984f450fd5be6680f3805944d3534cc2f /chrome/renderer/mock_render_thread.cc
parent519140983be01363138a1766d05fd5ff34bad34c (diff)
downloadchromium_src-81ac4a3fd428d19ec78072b8614a354cf0cc5c18.zip
chromium_src-81ac4a3fd428d19ec78072b8614a354cf0cc5c18.tar.gz
chromium_src-81ac4a3fd428d19ec78072b8614a354cf0cc5c18.tar.bz2
Revert 96406 - Print preview page selection should not require a rerendering of draft pages.
On page selection, regenerate the complete document with the selection, but preserve the existing draft pages and simply display a subset of them. 1. Added a new param |clear all preview data| to |PrintHostMsg_DidGetPreviewPageCount|. 2. Removed |requested_preview_page_index| from |PrintMsg_ContinuePreview| BUG=84383 TEST=print preview works after code changes. Review URL: http://codereview.chromium.org/7544018 TBR=kmadhusu@chromium.org Review URL: http://codereview.chromium.org/7618014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/mock_render_thread.cc')
-rw-r--r--chrome/renderer/mock_render_thread.cc29
1 files changed, 3 insertions, 26 deletions
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index 1a66d41..aac7156 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -16,7 +16,6 @@
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_sync_message.h"
#include "printing/print_job_constants.h"
-#include "printing/page_range.h"
#include "testing/gtest/include/gtest/gtest.h"
MockRenderThread::MockRenderThread()
@@ -214,8 +213,7 @@ void MockRenderThread::OnDidPrintPage(
void MockRenderThread::OnDidGetPreviewPageCount(int document_cookie,
int number_pages,
- bool is_modifiable,
- bool clear_preview_data) {
+ bool is_modifiable) {
print_preview_pages_remaining_ = number_pages;
}
@@ -244,29 +242,8 @@ void MockRenderThread::OnUpdatePrintSettings(
}
// Just return the default settings.
- if (printer_.get()) {
- ListValue* page_range_array = new ListValue();
- printing::PageRanges new_ranges;
- if (job_settings.GetList(printing::kSettingPageRange, &page_range_array)) {
- for (size_t index = 0; index < page_range_array->GetSize(); ++index) {
- DictionaryValue* dict;
- if (!page_range_array->GetDictionary(index, &dict))
- continue;
- printing::PageRange range;
- if (!dict->GetInteger(printing::kSettingPageRangeFrom, &range.from) ||
- !dict->GetInteger(printing::kSettingPageRangeTo, &range.to)) {
- continue;
- }
- // Page numbers are 1-based in the dictionary.
- // Page numbers are 0-based for the printing context.
- range.from--;
- range.to--;
- new_ranges.push_back(range);
- }
- }
- std::vector<int> pages(printing::PageRange::GetPages(new_ranges));
- printer_->UpdateSettings(document_cookie, params, pages);
- }
+ if (printer_.get())
+ printer_->UpdateSettings(document_cookie, params);
}
void MockRenderThread::set_print_dialog_user_response(bool response) {