| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 : root_window_(NULL), | 57 : root_window_(NULL), |
| 58 message_handler_(new HWNDMessageHandler(this)), | 58 message_handler_(new HWNDMessageHandler(this)), |
| 59 native_widget_delegate_(native_widget_delegate), | 59 native_widget_delegate_(native_widget_delegate), |
| 60 desktop_native_widget_aura_(desktop_native_widget_aura), | 60 desktop_native_widget_aura_(desktop_native_widget_aura), |
| 61 root_window_host_delegate_(NULL), | 61 root_window_host_delegate_(NULL), |
| 62 content_window_(NULL), | 62 content_window_(NULL), |
| 63 drag_drop_client_(NULL), | 63 drag_drop_client_(NULL), |
| 64 should_animate_window_close_(false), | 64 should_animate_window_close_(false), |
| 65 pending_close_(false), | 65 pending_close_(false), |
| 66 has_non_client_view_(false), | 66 has_non_client_view_(false), |
| 67 tooltip_(NULL) { | 67 tooltip_(NULL), |
| 68 is_cursor_visible_(true) { |
| 68 } | 69 } |
| 69 | 70 |
| 70 DesktopRootWindowHostWin::~DesktopRootWindowHostWin() { | 71 DesktopRootWindowHostWin::~DesktopRootWindowHostWin() { |
| 71 // WARNING: |content_window_| has been destroyed by the time we get here. | 72 // WARNING: |content_window_| has been destroyed by the time we get here. |
| 72 desktop_native_widget_aura_->OnDesktopRootWindowHostDestroyed( | 73 desktop_native_widget_aura_->OnDesktopRootWindowHostDestroyed( |
| 73 root_window_); | 74 root_window_); |
| 74 } | 75 } |
| 75 | 76 |
| 76 // static | 77 // static |
| 77 aura::Window* DesktopRootWindowHostWin::GetContentWindowForHWND(HWND hwnd) { | 78 aura::Window* DesktopRootWindowHostWin::GetContentWindowForHWND(HWND hwnd) { |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 RECT window_rect = root_window_->GetBoundsInScreen().ToRECT(); | 481 RECT window_rect = root_window_->GetBoundsInScreen().ToRECT(); |
| 481 ::ClipCursor(&window_rect); | 482 ::ClipCursor(&window_rect); |
| 482 return true; | 483 return true; |
| 483 } | 484 } |
| 484 | 485 |
| 485 void DesktopRootWindowHostWin::UnConfineCursor() { | 486 void DesktopRootWindowHostWin::UnConfineCursor() { |
| 486 ::ClipCursor(NULL); | 487 ::ClipCursor(NULL); |
| 487 } | 488 } |
| 488 | 489 |
| 489 void DesktopRootWindowHostWin::OnCursorVisibilityChanged(bool show) { | 490 void DesktopRootWindowHostWin::OnCursorVisibilityChanged(bool show) { |
| 491 if (is_cursor_visible_ == show) |
| 492 return; |
| 493 is_cursor_visible_ = show; |
| 490 ::ShowCursor(!!show); | 494 ::ShowCursor(!!show); |
| 491 } | 495 } |
| 492 | 496 |
| 493 void DesktopRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { | 497 void DesktopRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { |
| 494 POINT cursor_location = location.ToPOINT(); | 498 POINT cursor_location = location.ToPOINT(); |
| 495 ::ClientToScreen(GetHWND(), &cursor_location); | 499 ::ClientToScreen(GetHWND(), &cursor_location); |
| 496 ::SetCursorPos(cursor_location.x, cursor_location.y); | 500 ::SetCursorPos(cursor_location.x, cursor_location.y); |
| 497 } | 501 } |
| 498 | 502 |
| 499 void DesktopRootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) { | 503 void DesktopRootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 | 916 |
| 913 // static | 917 // static |
| 914 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 918 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 915 internal::NativeWidgetDelegate* native_widget_delegate, | 919 internal::NativeWidgetDelegate* native_widget_delegate, |
| 916 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 920 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 917 return new DesktopRootWindowHostWin(native_widget_delegate, | 921 return new DesktopRootWindowHostWin(native_widget_delegate, |
| 918 desktop_native_widget_aura); | 922 desktop_native_widget_aura); |
| 919 } | 923 } |
| 920 | 924 |
| 921 } // namespace views | 925 } // namespace views |
| OLD | NEW |