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

Side by Side Diff: ui/base/win/events_win.cc

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 4 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/base/events.h ('k') | ui/base/x/events_x.cc » ('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) 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 <windowsx.h> 5 #include <windowsx.h>
6 6
7 #include "ui/base/events.h" 7 #include "ui/base/events.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 DCHECK(IsNonClientMouseEvent(native_event) || 208 DCHECK(IsNonClientMouseEvent(native_event) ||
209 IsMouseWheelEvent(native_event)); 209 IsMouseWheelEvent(native_event));
210 // Non-client message. The position is contained in a POINTS structure in 210 // Non-client message. The position is contained in a POINTS structure in
211 // LPARAM, and is in screen coordinates so we have to convert to client. 211 // LPARAM, and is in screen coordinates so we have to convert to client.
212 POINT native_point = { GET_X_LPARAM(native_event.lParam), 212 POINT native_point = { GET_X_LPARAM(native_event.lParam),
213 GET_Y_LPARAM(native_event.lParam) }; 213 GET_Y_LPARAM(native_event.lParam) };
214 ScreenToClient(native_event.hwnd, &native_point); 214 ScreenToClient(native_event.hwnd, &native_point);
215 return gfx::Point(native_point); 215 return gfx::Point(native_point);
216 } 216 }
217 217
218 gfx::Point EventSystemLocationFromNative(
219 const base::NativeEvent& native_event) {
220 // TODO(ben): Needs to always return screen position here. Returning normal
221 // origin for now since that's obviously wrong.
222 return gfx::Point(0, 0);
223 }
224
218 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { 225 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
219 return KeyboardCodeForWindowsKeyCode(native_event.wParam); 226 return KeyboardCodeForWindowsKeyCode(native_event.wParam);
220 } 227 }
221 228
222 bool IsMouseEvent(const base::NativeEvent& native_event) { 229 bool IsMouseEvent(const base::NativeEvent& native_event) {
223 return IsClientMouseEvent(native_event) || 230 return IsClientMouseEvent(native_event) ||
224 IsNonClientMouseEvent(native_event); 231 IsNonClientMouseEvent(native_event);
225 } 232 }
226 233
227 int GetChangedMouseButtonFlagsFromNative( 234 int GetChangedMouseButtonFlagsFromNative(
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // Windows emulates mouse messages for touch events. 342 // Windows emulates mouse messages for touch events.
336 bool IsMouseEventFromTouch(UINT message) { 343 bool IsMouseEventFromTouch(UINT message) {
337 return (message == WM_MOUSEMOVE || 344 return (message == WM_MOUSEMOVE ||
338 message == WM_LBUTTONDOWN || message == WM_LBUTTONUP || 345 message == WM_LBUTTONDOWN || message == WM_LBUTTONUP ||
339 message == WM_RBUTTONDOWN || message == WM_RBUTTONUP) && 346 message == WM_RBUTTONDOWN || message == WM_RBUTTONUP) &&
340 (GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == 347 (GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) ==
341 MOUSEEVENTF_FROMTOUCH; 348 MOUSEEVENTF_FROMTOUCH;
342 } 349 }
343 350
344 } // namespace ui 351 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/events.h ('k') | ui/base/x/events_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698