| 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_root_window_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" |
| 6 | 6 |
| 7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
| 8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 MONITORINFO monitor_info; | 229 MONITORINFO monitor_info; |
| 230 monitor_info.cbSize = sizeof(monitor_info); | 230 monitor_info.cbSize = sizeof(monitor_info); |
| 231 GetMonitorInfo(MonitorFromWindow(message_handler_->hwnd(), | 231 GetMonitorInfo(MonitorFromWindow(message_handler_->hwnd(), |
| 232 MONITOR_DEFAULTTONEAREST), | 232 MONITOR_DEFAULTTONEAREST), |
| 233 &monitor_info); | 233 &monitor_info); |
| 234 gfx::Rect pixel_bounds = gfx::Rect(monitor_info.rcWork); | 234 gfx::Rect pixel_bounds = gfx::Rect(monitor_info.rcWork); |
| 235 return gfx::win::ScreenToDIPRect(pixel_bounds); | 235 return gfx::win::ScreenToDIPRect(pixel_bounds); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void DesktopRootWindowHostWin::SetShape(gfx::NativeRegion native_region) { | 238 void DesktopRootWindowHostWin::SetShape(gfx::NativeRegion native_region) { |
| 239 SkPath path; | 239 if (native_region) { |
| 240 native_region->getBoundaryPath(&path); | 240 SkPath path; |
| 241 message_handler_->SetRegion(gfx::CreateHRGNFromSkPath(path)); | 241 native_region->getBoundaryPath(&path); |
| 242 message_handler_->SetRegion(gfx::CreateHRGNFromSkPath(path)); |
| 243 } else { |
| 244 message_handler_->SetRegion(NULL); |
| 245 } |
| 246 |
| 247 delete native_region; |
| 242 } | 248 } |
| 243 | 249 |
| 244 void DesktopRootWindowHostWin::Activate() { | 250 void DesktopRootWindowHostWin::Activate() { |
| 245 message_handler_->Activate(); | 251 message_handler_->Activate(); |
| 246 } | 252 } |
| 247 | 253 |
| 248 void DesktopRootWindowHostWin::Deactivate() { | 254 void DesktopRootWindowHostWin::Deactivate() { |
| 249 message_handler_->Deactivate(); | 255 message_handler_->Deactivate(); |
| 250 } | 256 } |
| 251 | 257 |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 | 910 |
| 905 // static | 911 // static |
| 906 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 912 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 907 internal::NativeWidgetDelegate* native_widget_delegate, | 913 internal::NativeWidgetDelegate* native_widget_delegate, |
| 908 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 914 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 909 return new DesktopRootWindowHostWin(native_widget_delegate, | 915 return new DesktopRootWindowHostWin(native_widget_delegate, |
| 910 desktop_native_widget_aura); | 916 desktop_native_widget_aura); |
| 911 } | 917 } |
| 912 | 918 |
| 913 } // namespace views | 919 } // namespace views |
| OLD | NEW |