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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 RECT window_rect = root_window_->window()->GetBoundsInScreen().ToRECT(); | 482 RECT window_rect = root_window_->window()->GetBoundsInScreen().ToRECT(); |
482 ::ClipCursor(&window_rect); | 483 ::ClipCursor(&window_rect); |
483 return true; | 484 return true; |
484 } | 485 } |
485 | 486 |
486 void DesktopRootWindowHostWin::UnConfineCursor() { | 487 void DesktopRootWindowHostWin::UnConfineCursor() { |
487 ::ClipCursor(NULL); | 488 ::ClipCursor(NULL); |
488 } | 489 } |
489 | 490 |
490 void DesktopRootWindowHostWin::OnCursorVisibilityChanged(bool show) { | 491 void DesktopRootWindowHostWin::OnCursorVisibilityChanged(bool show) { |
| 492 if (is_cursor_visible_ == show) |
| 493 return; |
| 494 is_cursor_visible_ = show; |
491 ::ShowCursor(!!show); | 495 ::ShowCursor(!!show); |
492 } | 496 } |
493 | 497 |
494 void DesktopRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { | 498 void DesktopRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { |
495 POINT cursor_location = location.ToPOINT(); | 499 POINT cursor_location = location.ToPOINT(); |
496 ::ClientToScreen(GetHWND(), &cursor_location); | 500 ::ClientToScreen(GetHWND(), &cursor_location); |
497 ::SetCursorPos(cursor_location.x, cursor_location.y); | 501 ::SetCursorPos(cursor_location.x, cursor_location.y); |
498 } | 502 } |
499 | 503 |
500 void DesktopRootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) { | 504 void DesktopRootWindowHostWin::SetFocusWhenShown(bool focus_when_shown) { |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 | 917 |
914 // static | 918 // static |
915 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 919 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
916 internal::NativeWidgetDelegate* native_widget_delegate, | 920 internal::NativeWidgetDelegate* native_widget_delegate, |
917 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 921 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
918 return new DesktopRootWindowHostWin(native_widget_delegate, | 922 return new DesktopRootWindowHostWin(native_widget_delegate, |
919 desktop_native_widget_aura); | 923 desktop_native_widget_aura); |
920 } | 924 } |
921 | 925 |
922 } // namespace views | 926 } // namespace views |
OLD | NEW |