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

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

Issue 8597010: Send fake event when event_type is set to exit menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use xdisplay_ Created 9 years, 1 month 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/base/events.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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 gfx::Point DesktopHostWin::QueryMouseLocation() { 219 gfx::Point DesktopHostWin::QueryMouseLocation() {
220 POINT pt; 220 POINT pt;
221 GetCursorPos(&pt); 221 GetCursorPos(&pt);
222 ScreenToClient(hwnd(), &pt); 222 ScreenToClient(hwnd(), &pt);
223 const gfx::Size size = GetSize(); 223 const gfx::Size size = GetSize();
224 return gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))), 224 return gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))),
225 max(0, min(size.height(), static_cast<int>(pt.y)))); 225 max(0, min(size.height(), static_cast<int>(pt.y))));
226 } 226 }
227 227
228 void DesktopHostWin::PostNativeEvent(const base::NativeEvent& native_event) {
229 ::PostMessage(
230 hwnd(), native_event.message, native_event.wParam, native_event.lParam);
231 }
232
228 void DesktopHostWin::OnClose() { 233 void DesktopHostWin::OnClose() {
229 // TODO: this obviously shouldn't be here. 234 // TODO: this obviously shouldn't be here.
230 MessageLoopForUI::current()->Quit(); 235 MessageLoopForUI::current()->Quit();
231 } 236 }
232 237
233 LRESULT DesktopHostWin::OnKeyEvent(UINT message, 238 LRESULT DesktopHostWin::OnKeyEvent(UINT message,
234 WPARAM w_param, 239 WPARAM w_param,
235 LPARAM l_param) { 240 LPARAM l_param) {
236 MSG msg = { hwnd(), message, w_param, l_param }; 241 MSG msg = { hwnd(), message, w_param, l_param };
237 KeyEvent keyev(msg, message == WM_CHAR); 242 KeyEvent keyev(msg, message == WM_CHAR);
(...skipping 20 matching lines...) Expand all
258 } 263 }
259 264
260 void DesktopHostWin::OnSize(UINT param, const CSize& size) { 265 void DesktopHostWin::OnSize(UINT param, const CSize& size) {
261 // Minimizing resizes the window to 0x0 which causes our layout to go all 266 // Minimizing resizes the window to 0x0 which causes our layout to go all
262 // screwy, so we just ignore it. 267 // screwy, so we just ignore it.
263 if (param != SIZE_MINIMIZED) 268 if (param != SIZE_MINIMIZED)
264 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); 269 desktop_->OnHostResized(gfx::Size(size.cx, size.cy));
265 } 270 }
266 271
267 } // namespace aura 272 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/desktop_host_win.h ('k') | ui/base/events.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698