summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 00:08:33 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 00:08:33 +0000
commitf4400e20f17ddd975688b9e2d43fde7d2c3387d8 (patch)
treebf9fe172614df36c64e653ae0b9763155a3d0c47
parent3f4a50f70dc37fde21637a15d83c302df172860a (diff)
downloadchromium_src-f4400e20f17ddd975688b9e2d43fde7d2c3387d8.zip
chromium_src-f4400e20f17ddd975688b9e2d43fde7d2c3387d8.tar.gz
chromium_src-f4400e20f17ddd975688b9e2d43fde7d2c3387d8.tar.bz2
Removed unused code path.
reuse_existing_data is never set true. It should be removed with https://codereview.chromium.org/26558003 Review URL: https://codereview.chromium.org/81563002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236642 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/printing/print_preview_message_handler.cc12
-rw-r--r--chrome/browser/resources/print_preview/native_layer.js18
-rw-r--r--chrome/browser/resources/print_preview/preview_generator.js23
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_ui.cc7
-rw-r--r--chrome/browser/ui/webui/print_preview/print_preview_ui.h4
-rw-r--r--chrome/common/print_messages.h4
-rw-r--r--chrome/renderer/printing/print_web_view_helper.cc1
7 files changed, 0 insertions, 69 deletions
diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc
index c629717..e603806 100644
--- a/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chrome/browser/printing/print_preview_message_handler.cc
@@ -146,18 +146,6 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
if (!print_preview_ui)
return;
- if (params.reuse_existing_data) {
- // Need to match normal rendering where we are expected to send this.
- PrintHostMsg_DidGetPreviewPageCount_Params temp_params;
- temp_params.page_count = params.expected_pages_count;
- temp_params.document_cookie = params.document_cookie;
- temp_params.is_modifiable = params.modifiable;
- temp_params.preview_request_id = params.preview_request_id;
- print_preview_ui->OnDidGetPreviewPageCount(temp_params);
- print_preview_ui->OnReusePreviewData(params.preview_request_id);
- return;
- }
-
// TODO(joth): This seems like a good match for using RefCountedStaticMemory
// to avoid the memory copy, but the SetPrintPreviewData call chain below
// needs updating to accept the RefCountedMemory* base class.
diff --git a/chrome/browser/resources/print_preview/native_layer.js b/chrome/browser/resources/print_preview/native_layer.js
index 3e4cf11..a5c133f 100644
--- a/chrome/browser/resources/print_preview/native_layer.js
+++ b/chrome/browser/resources/print_preview/native_layer.js
@@ -36,7 +36,6 @@ cr.define('print_preview', function() {
this.onDidGetDefaultPageLayout_.bind(this);
global['onDidGetPreviewPageCount'] =
this.onDidGetPreviewPageCount_.bind(this);
- global['reloadPreviewPages'] = this.onReloadPreviewPages_.bind(this);
global['onDidPreviewPage'] = this.onDidPreviewPage_.bind(this);
global['updatePrintPreview'] = this.onUpdatePrintPreview_.bind(this);
global['printScalingDisabledForSourcePDF'] =
@@ -75,7 +74,6 @@ cr.define('print_preview', function() {
'print_preview.NativeLayer.PREVIEW_GENERATION_DONE',
PREVIEW_GENERATION_FAIL:
'print_preview.NativeLayer.PREVIEW_GENERATION_FAIL',
- PREVIEW_RELOAD: 'print_preview.NativeLayer.PREVIEW_RELOAD',
PRINT_TO_CLOUD: 'print_preview.NativeLayer.PRINT_TO_CLOUD',
SETTINGS_INVALID: 'print_preview.NativeLayer.SETTINGS_INVALID',
PRIVET_PRINTER_CHANGED: 'print_preview.NativeLayer.PRIVET_PRINTER_CHANGED',
@@ -173,7 +171,6 @@ cr.define('print_preview', function() {
* - PAGE_PREVIEW_READY
* - PREVIEW_GENERATION_DONE
* - PREVIEW_GENERATION_FAIL
- * - PREVIEW_RELOAD
* @param {print_preview.Destination} destination Destination to print to.
* @param {!print_preview.PrintTicketStore} printTicketStore Used to get the
* state of the print ticket.
@@ -560,21 +557,6 @@ cr.define('print_preview', function() {
},
/**
- * Called when no pipelining previewed pages.
- * @param {number} previewUid Preview unique identifier.
- * @param {number} previewResponseId The preview request id that resulted in
- * this response.
- * @private
- */
- onReloadPreviewPages_: function(previewUid, previewResponseId) {
- var previewReloadEvent = new Event(
- NativeLayer.EventType.PREVIEW_RELOAD);
- previewReloadEvent.previewUid = previewUid;
- previewReloadEvent.previewResponseId = previewResponseId;
- this.dispatchEvent(previewReloadEvent);
- },
-
- /**
* Notification that a print preview page has been rendered.
* Check if the settings have changed and request a regeneration if needed.
* Called from PrintPreviewUI::OnDidPreviewPage().
diff --git a/chrome/browser/resources/print_preview/preview_generator.js b/chrome/browser/resources/print_preview/preview_generator.js
index d0a7376..a26345c 100644
--- a/chrome/browser/resources/print_preview/preview_generator.js
+++ b/chrome/browser/resources/print_preview/preview_generator.js
@@ -205,10 +205,6 @@ cr.define('print_preview', function() {
this.onPageCountReady_.bind(this));
this.tracker_.add(
this.nativeLayer_,
- print_preview.NativeLayer.EventType.PREVIEW_RELOAD,
- this.onPreviewReload_.bind(this));
- this.tracker_.add(
- this.nativeLayer_,
print_preview.NativeLayer.EventType.PAGE_PREVIEW_READY,
this.onPagePreviewReady_.bind(this));
this.tracker_.add(
@@ -340,25 +336,6 @@ cr.define('print_preview', function() {
},
/**
- * Called when the print preview should be reloaded.
- * @param {Event} event Contains the preview UID and request ID.
- * @private
- */
- onPreviewReload_: function(event) {
- if (this.inFlightRequestId_ != event.previewResponseId) {
- return; // Ignore old response.
- }
- var pageNumberSet = this.printTicketStore_.pageRange.getPageNumberSet();
- this.dispatchPreviewStartEvent_(
- event.previewUid, pageNumberSet.getPageNumberAt(0) - 1);
- for (var i = 0; i < pageNumberSet.size; i++) {
- var pageNumber = pageNumberSet.getPageNumberAt(i);
- this.dispatchPageReadyEvent_(i, pageNumber, event.previewUid);
- }
- cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.DOCUMENT_READY);
- },
-
- /**
* Called when a page's preview has been generated. Dispatches a
* PAGE_READY event.
* @param {Event} event Contains the page index and preview UID.
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
index 8576382..010925c5 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -518,13 +518,6 @@ void PrintPreviewUI::OnDidPreviewPage(int page_number,
web_ui()->CallJavascriptFunction("autoCancelForTesting");
}
-void PrintPreviewUI::OnReusePreviewData(int preview_request_id) {
- base::FundamentalValue ui_identifier(id_);
- base::FundamentalValue ui_preview_request_id(preview_request_id);
- web_ui()->CallJavascriptFunction("reloadPreviewPages", ui_identifier,
- ui_preview_request_id);
-}
-
void PrintPreviewUI::OnPreviewDataIsAvailable(int expected_pages_count,
int preview_request_id) {
VLOG(1) << "Print preview request finished with "
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.h b/chrome/browser/ui/webui/print_preview/print_preview_ui.h
index ab893bb..33fcd80 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_ui.h
+++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.h
@@ -104,10 +104,6 @@ class PrintPreviewUI : public ConstrainedWebDialogUI {
void OnPreviewDataIsAvailable(int expected_pages_count,
int preview_request_id);
- // Notifies the Web UI renderer to reuse the preview data.
- // |preview_request_id| indicates which request resulted in this response.
- void OnReusePreviewData(int preview_request_id);
-
// Notifies the Web UI that preview dialog has been destroyed. This is the
// last chance to communicate with the initiator before the association is
// erased.
diff --git a/chrome/common/print_messages.h b/chrome/common/print_messages.h
index dc9248b..d4de3ce 100644
--- a/chrome/common/print_messages.h
+++ b/chrome/common/print_messages.h
@@ -183,10 +183,6 @@ IPC_STRUCT_TRAITS_END()
// Parameters to describe a rendered document.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
- // True when we can reuse existing preview data. |metafile_data_handle| and
- // |data_size| should not be used when this is true.
- IPC_STRUCT_MEMBER(bool, reuse_existing_data)
-
// A shared memory handle to metafile data.
IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle)
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc
index 70faa91..c891b25 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -1095,7 +1095,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK_GT(buf_size, 0u);
PrintHostMsg_DidPreviewDocument_Params preview_params;
- preview_params.reuse_existing_data = false;
preview_params.data_size = buf_size;
preview_params.document_cookie = print_pages_params_->params.document_cookie;
preview_params.expected_pages_count =