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

Unified Diff: ui/views/event_utils_win.cc

Issue 245993005: views: move native event reposting back to MenuController as it's the only (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win compile Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/event_utils_aura.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/event_utils_win.cc
diff --git a/ui/views/event_utils_win.cc b/ui/views/event_utils_win.cc
deleted file mode 100644
index 78cb9df791fd6c75c0f9db0afc3f2f80c8727ae7..0000000000000000000000000000000000000000
--- a/ui/views/event_utils_win.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/views/event_utils.h"
-
-#include <windowsx.h>
-
-#include "base/logging.h"
-#include "ui/events/event.h"
-#include "ui/events/event_constants.h"
-#include "ui/gfx/point.h"
-
-namespace views {
-
-bool RepostLocatedEventWin(HWND window,
- const ui::LocatedEvent& event) {
- if (!window)
- return false;
-
- // Determine whether the click was in the client area or not.
- // NOTE: WM_NCHITTEST coordinates are relative to the screen.
- const gfx::Point screen_loc = event.location();
- LRESULT nc_hit_result = SendMessage(window, WM_NCHITTEST, 0,
- MAKELPARAM(screen_loc.x(),
- screen_loc.y()));
- const bool in_client_area = nc_hit_result == HTCLIENT;
-
- // TODO(sky): this isn't right. The event to generate should correspond with
- // the event we just got. MouseEvent only tells us what is down, which may
- // differ. Need to add ability to get changed button from MouseEvent.
- int event_type;
- int flags = event.flags();
- if (flags & ui::EF_LEFT_MOUSE_BUTTON) {
- event_type = in_client_area ? WM_LBUTTONDOWN : WM_NCLBUTTONDOWN;
- } else if (flags & ui::EF_MIDDLE_MOUSE_BUTTON) {
- event_type = in_client_area ? WM_MBUTTONDOWN : WM_NCMBUTTONDOWN;
- } else if (flags & ui::EF_RIGHT_MOUSE_BUTTON) {
- event_type = in_client_area ? WM_RBUTTONDOWN : WM_NCRBUTTONDOWN;
- } else {
- NOTREACHED();
- return false;
- }
-
- int window_x = screen_loc.x();
- int window_y = screen_loc.y();
- if (in_client_area) {
- POINT pt = {window_x, window_y};
- ScreenToClient(window, &pt);
- window_x = pt.x;
- window_y = pt.y;
- }
-
- WPARAM target = in_client_area ? event.native_event().wParam : nc_hit_result;
- PostMessage(window, event_type, target, MAKELPARAM(window_x, window_y));
- return true;
-}
-
-} // namespace views
« no previous file with comments | « ui/views/event_utils_aura.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698