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

Side by Side Diff: printing/printing_context_system_dialog_win.cc

Issue 1083433003: Fix crash from ipc_fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fri Apr 10 17:22:28 PDT 2015 Created 5 years, 8 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 | « chrome/browser/printing/print_view_manager_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "printing/printing_context_system_dialog_win.h" 5 #include "printing/printing_context_system_dialog_win.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "printing/backend/win_helper.h" 9 #include "printing/backend/win_helper.h"
10 #include "printing/print_settings_initializer_win.h" 10 #include "printing/print_settings_initializer_win.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 dialog_options.nMaxPage = max_pages; 62 dialog_options.nMaxPage = max_pages;
63 dialog_options.lpPageRanges = ranges; 63 dialog_options.lpPageRanges = ranges;
64 } else { 64 } else {
65 // No need to bother, we don't know how many pages are available. 65 // No need to bother, we don't know how many pages are available.
66 dialog_options.Flags |= PD_NOPAGENUMS; 66 dialog_options.Flags |= PD_NOPAGENUMS;
67 } 67 }
68 68
69 if (ShowPrintDialog(&dialog_options) != S_OK) { 69 if (ShowPrintDialog(&dialog_options) != S_OK) {
70 ResetSettings(); 70 ResetSettings();
71 callback.Run(FAILED); 71 callback.Run(FAILED);
72 return;
72 } 73 }
73 74
74 // TODO(maruel): Support PD_PRINTTOFILE. 75 // TODO(maruel): Support PD_PRINTTOFILE.
75 callback.Run(ParseDialogResultEx(dialog_options)); 76 callback.Run(ParseDialogResultEx(dialog_options));
76 } 77 }
77 78
78 HRESULT PrintingContextSytemDialogWin::ShowPrintDialog(PRINTDLGEX* options) { 79 HRESULT PrintingContextSytemDialogWin::ShowPrintDialog(PRINTDLGEX* options) {
79 // Runs always on the UI thread. 80 // Runs always on the UI thread.
80 static bool is_dialog_shown = false; 81 static bool is_dialog_shown = false;
81 if (is_dialog_shown) 82 if (is_dialog_shown)
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 261
261 if (dialog_options.hDevMode != NULL) 262 if (dialog_options.hDevMode != NULL)
262 GlobalFree(dialog_options.hDevMode); 263 GlobalFree(dialog_options.hDevMode);
263 if (dialog_options.hDevNames != NULL) 264 if (dialog_options.hDevNames != NULL)
264 GlobalFree(dialog_options.hDevNames); 265 GlobalFree(dialog_options.hDevNames);
265 266
266 return context() ? OK : FAILED; 267 return context() ? OK : FAILED;
267 } 268 }
268 269
269 } // namespace printing 270 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698