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

Side by Side Diff: ui/views/event_utils_win.cc

Issue 191723003: Nukes USE_AURA ifdefs from views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/views/event_utils.h" 5 #include "ui/views/event_utils.h"
6 6
7 #include <windowsx.h> 7 #include <windowsx.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
11 #include "ui/events/event_constants.h" 11 #include "ui/events/event_constants.h"
12 #include "ui/gfx/point.h" 12 #include "ui/gfx/point.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 #if defined(USE_AURA)
17 bool RepostLocatedEventWin(HWND window, 16 bool RepostLocatedEventWin(HWND window,
18 const ui::LocatedEvent& event) { 17 const ui::LocatedEvent& event) {
19 #else
20 bool RepostLocatedEvent(gfx::NativeWindow window,
21 const ui::LocatedEvent& event) {
22 #endif
23 if (!window) 18 if (!window)
24 return false; 19 return false;
25 20
26 // Determine whether the click was in the client area or not. 21 // Determine whether the click was in the client area or not.
27 // NOTE: WM_NCHITTEST coordinates are relative to the screen. 22 // NOTE: WM_NCHITTEST coordinates are relative to the screen.
28 const gfx::Point screen_loc = event.location(); 23 const gfx::Point screen_loc = event.location();
29 LRESULT nc_hit_result = SendMessage(window, WM_NCHITTEST, 0, 24 LRESULT nc_hit_result = SendMessage(window, WM_NCHITTEST, 0,
30 MAKELPARAM(screen_loc.x(), 25 MAKELPARAM(screen_loc.x(),
31 screen_loc.y())); 26 screen_loc.y()));
32 const bool in_client_area = nc_hit_result == HTCLIENT; 27 const bool in_client_area = nc_hit_result == HTCLIENT;
(...skipping 22 matching lines...) Expand all
55 window_x = pt.x; 50 window_x = pt.x;
56 window_y = pt.y; 51 window_y = pt.y;
57 } 52 }
58 53
59 WPARAM target = in_client_area ? event.native_event().wParam : nc_hit_result; 54 WPARAM target = in_client_area ? event.native_event().wParam : nc_hit_result;
60 PostMessage(window, event_type, target, MAKELPARAM(window_x, window_y)); 55 PostMessage(window, event_type, target, MAKELPARAM(window_x, window_y));
61 return true; 56 return true;
62 } 57 }
63 58
64 } // namespace views 59 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698