Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(964)

Side by Side Diff: ui/aura/desktop_host_win.cc

Issue 8342026: Get basic KeyEvents working in RWHVA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/desktop_host_win.h ('k') | ui/aura/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/aura/desktop_host_win.h ('k') | ui/aura/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698