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 <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 void DesktopHostWin::OnClose() { | 171 void DesktopHostWin::OnClose() { |
172 // TODO: this obviously shouldn't be here. | 172 // TODO: this obviously shouldn't be here. |
173 MessageLoopForUI::current()->Quit(); | 173 MessageLoopForUI::current()->Quit(); |
174 } | 174 } |
175 | 175 |
176 LRESULT DesktopHostWin::OnKeyEvent(UINT message, | 176 LRESULT DesktopHostWin::OnKeyEvent(UINT message, |
177 WPARAM w_param, | 177 WPARAM w_param, |
178 LPARAM l_param) { | 178 LPARAM l_param) { |
179 MSG msg = { hwnd(), message, w_param, l_param }; | 179 MSG msg = { hwnd(), message, w_param, l_param }; |
180 SetMsgHandled(desktop_->OnKeyEvent(KeyEvent(msg))); | 180 SetMsgHandled(desktop_->OnKeyEvent(KeyEvent(msg, message == WM_CHAR))); |
181 return 0; | 181 return 0; |
182 } | 182 } |
183 | 183 |
184 LRESULT DesktopHostWin::OnMouseRange(UINT message, | 184 LRESULT DesktopHostWin::OnMouseRange(UINT message, |
185 WPARAM w_param, | 185 WPARAM w_param, |
186 LPARAM l_param) { | 186 LPARAM l_param) { |
187 MSG msg = { hwnd(), message, w_param, l_param, 0, | 187 MSG msg = { hwnd(), message, w_param, l_param, 0, |
188 { GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param) } }; | 188 { GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param) } }; |
189 MouseEvent event(msg); | 189 MouseEvent event(msg); |
190 bool handled = false; | 190 bool handled = false; |
191 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) | 191 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) |
192 handled = desktop_->OnMouseEvent(event); | 192 handled = desktop_->OnMouseEvent(event); |
193 SetMsgHandled(handled); | 193 SetMsgHandled(handled); |
194 return 0; | 194 return 0; |
195 } | 195 } |
196 | 196 |
197 void DesktopHostWin::OnPaint(HDC dc) { | 197 void DesktopHostWin::OnPaint(HDC dc) { |
198 desktop_->Draw(); | 198 desktop_->Draw(); |
199 ValidateRect(hwnd(), NULL); | 199 ValidateRect(hwnd(), NULL); |
200 } | 200 } |
201 | 201 |
202 void DesktopHostWin::OnSize(UINT param, const CSize& size) { | 202 void DesktopHostWin::OnSize(UINT param, const CSize& size) { |
203 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); | 203 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); |
204 } | 204 } |
205 | 205 |
206 } // namespace aura | 206 } // namespace aura |
OLD | NEW |