| OLD | NEW |
| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 settings_.set_device_name(device_name); | 356 settings_.set_device_name(device_name); |
| 357 PrintSettingsInitializerWin::InitPrintSettings( | 357 PrintSettingsInitializerWin::InitPrintSettings( |
| 358 context_, *dev_mode, &settings_); | 358 context_, *dev_mode, &settings_); |
| 359 | 359 |
| 360 return OK; | 360 return OK; |
| 361 } | 361 } |
| 362 | 362 |
| 363 HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) { | 363 HWND PrintingContextWin::GetRootWindow(gfx::NativeView view) { |
| 364 HWND window = NULL; | 364 HWND window = NULL; |
| 365 #if defined(USE_AURA) | 365 #if defined(USE_AURA) |
| 366 if (view) | 366 if (view && view->GetHost()) |
| 367 window = view->GetHost()->GetAcceleratedWidget(); | 367 window = view->GetHost()->GetAcceleratedWidget(); |
| 368 #else | 368 #else |
| 369 if (view && IsWindow(view)) { | 369 if (view && IsWindow(view)) { |
| 370 window = GetAncestor(view, GA_ROOTOWNER); | 370 window = GetAncestor(view, GA_ROOTOWNER); |
| 371 } | 371 } |
| 372 #endif | 372 #endif |
| 373 if (!window) { | 373 if (!window) { |
| 374 // TODO(maruel): crbug.com/1214347 Get the right browser window instead. | 374 // TODO(maruel): crbug.com/1214347 Get the right browser window instead. |
| 375 return GetDesktopWindow(); | 375 return GetDesktopWindow(); |
| 376 } | 376 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 400 | 400 |
| 401 if (canceled) { | 401 if (canceled) { |
| 402 result.reset(); | 402 result.reset(); |
| 403 abort_printing_ = true; | 403 abort_printing_ = true; |
| 404 } | 404 } |
| 405 | 405 |
| 406 return result.Pass(); | 406 return result.Pass(); |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace printing | 409 } // namespace printing |
| OLD | NEW |