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()->host()->GetAcceleratedWidget(); | 44 window = view->GetHost()->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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 | 730 |
731 if (dialog_options.hDevMode != NULL) | 731 if (dialog_options.hDevMode != NULL) |
732 GlobalFree(dialog_options.hDevMode); | 732 GlobalFree(dialog_options.hDevMode); |
733 if (dialog_options.hDevNames != NULL) | 733 if (dialog_options.hDevNames != NULL) |
734 GlobalFree(dialog_options.hDevNames); | 734 GlobalFree(dialog_options.hDevNames); |
735 | 735 |
736 return context_ ? OK : FAILED; | 736 return context_ ? OK : FAILED; |
737 } | 737 } |
738 | 738 |
739 } // namespace printing | 739 } // namespace printing |
OLD | NEW |