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

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

Issue 2962983002: Print Preview: change getPreview to cr.sendWithPromise (Closed)
Patch Set: Fix check Created 3 years, 5 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 unified diff | Download patch
« 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (!print_preview_ui) 183 if (!print_preview_ui)
184 return; 184 return;
185 print_preview_ui->OnDidGetDefaultPageLayout(page_layout_in_points, 185 print_preview_ui->OnDidGetDefaultPageLayout(page_layout_in_points,
186 printable_area_in_points, 186 printable_area_in_points,
187 has_custom_page_size_style); 187 has_custom_page_size_style);
188 } 188 }
189 189
190 void PrintPreviewMessageHandler::OnPrintPreviewCancelled(int document_cookie) { 190 void PrintPreviewMessageHandler::OnPrintPreviewCancelled(int document_cookie) {
191 // Always need to stop the worker. 191 // Always need to stop the worker.
192 StopWorker(document_cookie); 192 StopWorker(document_cookie);
193
194 // Notify UI
195 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI();
196 if (!print_preview_ui)
197 return;
198 print_preview_ui->OnPrintPreviewCancelled();
193 } 199 }
194 200
195 void PrintPreviewMessageHandler::OnInvalidPrinterSettings(int document_cookie) { 201 void PrintPreviewMessageHandler::OnInvalidPrinterSettings(int document_cookie) {
196 StopWorker(document_cookie); 202 StopWorker(document_cookie);
197 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI(); 203 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI();
198 if (!print_preview_ui) 204 if (!print_preview_ui)
199 return; 205 return;
200 print_preview_ui->OnInvalidPrinterSettings(); 206 print_preview_ui->OnInvalidPrinterSettings();
201 } 207 }
202 208
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings, 243 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings,
238 OnInvalidPrinterSettings) 244 OnInvalidPrinterSettings)
239 IPC_MESSAGE_HANDLER(PrintHostMsg_SetOptionsFromDocument, 245 IPC_MESSAGE_HANDLER(PrintHostMsg_SetOptionsFromDocument,
240 OnSetOptionsFromDocument) 246 OnSetOptionsFromDocument)
241 IPC_MESSAGE_UNHANDLED(handled = false) 247 IPC_MESSAGE_UNHANDLED(handled = false)
242 IPC_END_MESSAGE_MAP() 248 IPC_END_MESSAGE_MAP()
243 return handled; 249 return handled;
244 } 250 }
245 251
246 } // namespace printing 252 } // 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