OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura/desktop_host_win.h" | 5 #include "ui/aura/desktop_host_win.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
9 #include "ui/aura/event.h" | 9 #include "ui/aura/event.h" |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 SetWindowPos( | 51 SetWindowPos( |
52 hwnd(), | 52 hwnd(), |
53 NULL, | 53 NULL, |
54 0, | 54 0, |
55 0, | 55 0, |
56 size.width(), | 56 size.width(), |
57 size.height(), | 57 size.height(), |
58 SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION); | 58 SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION); |
59 } | 59 } |
60 | 60 |
| 61 void DesktopHostWin::SetCursor(CursorType cursor_type) { |
| 62 switch (cursor_type) { |
| 63 case CURSOR_POINTER: |
| 64 ::SetCursor(LoadCursor(NULL, IDC_ARROW)); |
| 65 break; |
| 66 case CURSOR_LINK: |
| 67 ::SetCursor(LoadCursor(NULL, IDC_HAND)); |
| 68 break; |
| 69 case CURSOR_WAIT: |
| 70 ::SetCursor(LoadCursor(NULL, IDC_WAIT)); |
| 71 break; |
| 72 case CURSOR_SIZE_HORIZONTAL: |
| 73 ::SetCursor(LoadCursor(NULL, IDC_SIZEWE)); |
| 74 break; |
| 75 case CURSOR_SIZE_VERTICAL: |
| 76 ::SetCursor(LoadCursor(NULL, IDC_SIZENS)); |
| 77 break; |
| 78 default: |
| 79 break; |
| 80 } |
| 81 } |
| 82 |
61 void DesktopHostWin::OnClose() { | 83 void DesktopHostWin::OnClose() { |
62 // TODO: this obviously shouldn't be here. | 84 // TODO: this obviously shouldn't be here. |
63 MessageLoopForUI::current()->Quit(); | 85 MessageLoopForUI::current()->Quit(); |
64 } | 86 } |
65 | 87 |
66 LRESULT DesktopHostWin::OnKeyEvent(UINT message, | 88 LRESULT DesktopHostWin::OnKeyEvent(UINT message, |
67 WPARAM w_param, | 89 WPARAM w_param, |
68 LPARAM l_param) { | 90 LPARAM l_param) { |
69 MSG msg = { hwnd(), message, w_param, l_param }; | 91 MSG msg = { hwnd(), message, w_param, l_param }; |
70 SetMsgHandled(desktop_->OnKeyEvent(KeyEvent(msg))); | 92 SetMsgHandled(desktop_->OnKeyEvent(KeyEvent(msg))); |
(...skipping 16 matching lines...) Expand all Loading... |
87 void DesktopHostWin::OnPaint(HDC dc) { | 109 void DesktopHostWin::OnPaint(HDC dc) { |
88 desktop_->Draw(); | 110 desktop_->Draw(); |
89 ValidateRect(hwnd(), NULL); | 111 ValidateRect(hwnd(), NULL); |
90 } | 112 } |
91 | 113 |
92 void DesktopHostWin::OnSize(UINT param, const CSize& size) { | 114 void DesktopHostWin::OnSize(UINT param, const CSize& size) { |
93 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); | 115 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); |
94 } | 116 } |
95 | 117 |
96 } // namespace aura | 118 } // namespace aura |
OLD | NEW |