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

Side by Side Diff: printing/printing_context_win.cc

Issue 934393003: Block nested system print dialogs on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_crash
Patch Set: Mon Feb 23 09:47:28 PST 2015 Created 5 years, 10 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 | « printing/printing_context_system_dialog_win.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 (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 "printing/printing_context_win.h" 5 #include "printing/printing_context_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 DCHECK(!in_print_job_); 352 DCHECK(!in_print_job_);
353 settings_.set_device_name(device_name); 353 settings_.set_device_name(device_name);
354 PrintSettingsInitializerWin::InitPrintSettings( 354 PrintSettingsInitializerWin::InitPrintSettings(
355 context_, *dev_mode, &settings_); 355 context_, *dev_mode, &settings_);
356 356
357 return OK; 357 return OK;
358 } 358 }
359 359
360 HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) { 360 HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) {
361 HWND window = NULL; 361 HWND window = NULL;
362 if (view) 362 if (view && view->GetHost())
363 window = view->GetHost()->GetAcceleratedWidget(); 363 window = view->GetHost()->GetAcceleratedWidget();
364 if (!window) { 364 if (!window) {
365 // TODO(maruel): crbug.com/1214347 Get the right browser window instead. 365 // TODO(maruel): crbug.com/1214347 Get the right browser window instead.
366 return GetDesktopWindow(); 366 return GetDesktopWindow();
367 } 367 }
368 return window; 368 return window;
369 } 369 }
370 370
371 scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog( 371 scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog(
372 HANDLE printer, 372 HANDLE printer,
(...skipping 18 matching lines...) Expand all
391 391
392 if (canceled) { 392 if (canceled) {
393 result.reset(); 393 result.reset();
394 abort_printing_ = true; 394 abort_printing_ = true;
395 } 395 }
396 396
397 return result.Pass(); 397 return result.Pass();
398 } 398 }
399 399
400 } // namespace printing 400 } // namespace printing
OLDNEW
« no previous file with comments | « printing/printing_context_system_dialog_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698