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 <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 #endif | 34 #endif |
35 | 35 |
36 using base::Time; | 36 using base::Time; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 HWND GetRootWindow(gfx::NativeView view) { | 40 HWND GetRootWindow(gfx::NativeView view) { |
41 HWND window = NULL; | 41 HWND window = NULL; |
42 #if defined(USE_AURA) | 42 #if defined(USE_AURA) |
43 if (view) | 43 if (view) |
44 window = view->GetDispatcher()->GetAcceleratedWidget(); | 44 window = view->GetDispatcher()->host()->GetAcceleratedWidget(); |
45 #else | 45 #else |
46 if (view && IsWindow(view)) { | 46 if (view && IsWindow(view)) { |
47 window = GetAncestor(view, GA_ROOTOWNER); | 47 window = GetAncestor(view, GA_ROOTOWNER); |
48 } | 48 } |
49 #endif | 49 #endif |
50 if (!window) { | 50 if (!window) { |
51 // TODO(maruel): bug 1214347 Get the right browser window instead. | 51 // TODO(maruel): bug 1214347 Get the right browser window instead. |
52 return GetDesktopWindow(); | 52 return GetDesktopWindow(); |
53 } | 53 } |
54 return window; | 54 return window; |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 742 |
743 if (dialog_options.hDevMode != NULL) | 743 if (dialog_options.hDevMode != NULL) |
744 GlobalFree(dialog_options.hDevMode); | 744 GlobalFree(dialog_options.hDevMode); |
745 if (dialog_options.hDevNames != NULL) | 745 if (dialog_options.hDevNames != NULL) |
746 GlobalFree(dialog_options.hDevNames); | 746 GlobalFree(dialog_options.hDevNames); |
747 | 747 |
748 return context_ ? OK : FAILED; | 748 return context_ ? OK : FAILED; |
749 } | 749 } |
750 | 750 |
751 } // namespace printing | 751 } // namespace printing |
OLD | NEW |