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

Side by Side Diff: chrome/browser/printing/print_preview_message_handler.cc

Issue 81563002: Removed unused code path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/native_layer.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_preview_message_handler.h" 5 #include "chrome/browser/printing/print_preview_message_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 if (params.expected_pages_count <= 0) { 140 if (params.expected_pages_count <= 0) {
141 NOTREACHED(); 141 NOTREACHED();
142 return; 142 return;
143 } 143 }
144 144
145 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI(); 145 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI();
146 if (!print_preview_ui) 146 if (!print_preview_ui)
147 return; 147 return;
148 148
149 if (params.reuse_existing_data) {
150 // Need to match normal rendering where we are expected to send this.
151 PrintHostMsg_DidGetPreviewPageCount_Params temp_params;
152 temp_params.page_count = params.expected_pages_count;
153 temp_params.document_cookie = params.document_cookie;
154 temp_params.is_modifiable = params.modifiable;
155 temp_params.preview_request_id = params.preview_request_id;
156 print_preview_ui->OnDidGetPreviewPageCount(temp_params);
157 print_preview_ui->OnReusePreviewData(params.preview_request_id);
158 return;
159 }
160
161 // TODO(joth): This seems like a good match for using RefCountedStaticMemory 149 // TODO(joth): This seems like a good match for using RefCountedStaticMemory
162 // to avoid the memory copy, but the SetPrintPreviewData call chain below 150 // to avoid the memory copy, but the SetPrintPreviewData call chain below
163 // needs updating to accept the RefCountedMemory* base class. 151 // needs updating to accept the RefCountedMemory* base class.
164 base::RefCountedBytes* data_bytes = 152 base::RefCountedBytes* data_bytes =
165 GetDataFromHandle(params.metafile_data_handle, params.data_size); 153 GetDataFromHandle(params.metafile_data_handle, params.data_size);
166 if (!data_bytes || !data_bytes->size()) 154 if (!data_bytes || !data_bytes->size())
167 return; 155 return;
168 156
169 print_preview_ui->SetPrintPreviewDataForIndex(COMPLETE_PREVIEW_DOCUMENT_INDEX, 157 print_preview_ui->SetPrintPreviewDataForIndex(COMPLETE_PREVIEW_DOCUMENT_INDEX,
170 data_bytes); 158 data_bytes);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings, 222 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings,
235 OnInvalidPrinterSettings) 223 OnInvalidPrinterSettings)
236 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewScalingDisabled, 224 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewScalingDisabled,
237 OnPrintPreviewScalingDisabled) 225 OnPrintPreviewScalingDisabled)
238 IPC_MESSAGE_UNHANDLED(handled = false) 226 IPC_MESSAGE_UNHANDLED(handled = false)
239 IPC_END_MESSAGE_MAP() 227 IPC_END_MESSAGE_MAP()
240 return handled; 228 return handled;
241 } 229 }
242 230
243 } // namespace printing 231 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/native_layer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698