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 "ui/views/widget/desktop_aura/desktop_screen_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/root_window_host.h" | 9 #include "ui/aura/root_window_host.h" |
10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 bool DesktopScreenWin::IsDIPEnabled() { | 46 bool DesktopScreenWin::IsDIPEnabled() { |
47 return true; | 47 return true; |
48 } | 48 } |
49 | 49 |
50 gfx::Display DesktopScreenWin::GetDisplayMatching( | 50 gfx::Display DesktopScreenWin::GetDisplayMatching( |
51 const gfx::Rect& match_rect) const { | 51 const gfx::Rect& match_rect) const { |
52 return GetDisplayNearestPoint(match_rect.CenterPoint()); | 52 return GetDisplayNearestPoint(match_rect.CenterPoint()); |
53 } | 53 } |
54 | 54 |
55 HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const { | 55 HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const { |
56 aura::RootWindow* root_window = window->GetRootWindow(); | 56 aura::WindowEventDispatcher* dispatcher = window->GetDispatcher(); |
57 return root_window ? root_window->GetAcceleratedWidget() : NULL; | 57 return dispatcher ? dispatcher->GetAcceleratedWidget() : NULL; |
58 } | 58 } |
59 | 59 |
60 gfx::NativeWindow DesktopScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | 60 gfx::NativeWindow DesktopScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
61 return (::IsWindow(hwnd)) ? | 61 return (::IsWindow(hwnd)) ? |
62 DesktopRootWindowHostWin::GetContentWindowForHWND(hwnd) : NULL; | 62 DesktopRootWindowHostWin::GetContentWindowForHWND(hwnd) : NULL; |
63 } | 63 } |
64 | 64 |
65 //////////////////////////////////////////////////////////////////////////////// | 65 //////////////////////////////////////////////////////////////////////////////// |
66 | 66 |
67 gfx::Screen* CreateDesktopScreen() { | 67 gfx::Screen* CreateDesktopScreen() { |
68 return new DesktopScreenWin; | 68 return new DesktopScreenWin; |
69 } | 69 } |
70 | 70 |
71 } // namespace views | 71 } // namespace views |
OLD | NEW |