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

Unified Diff: ui/views/mus/pointer_watcher_event_router.cc

Issue 2256343003: Update ui::PointerEvent to support mouse wheel and capture change events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/event_unittest.cc ('k') | ui/views/mus/pointer_watcher_event_router_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/pointer_watcher_event_router.cc
diff --git a/ui/views/mus/pointer_watcher_event_router.cc b/ui/views/mus/pointer_watcher_event_router.cc
index fce39f0c77542bf7991fd3ac72b22f0d81a75813..998c4cf0d61c6f3a77a654c2aae568275a6b4d0c 100644
--- a/ui/views/mus/pointer_watcher_event_router.cc
+++ b/ui/views/mus/pointer_watcher_event_router.cc
@@ -6,6 +6,7 @@
#include "services/ui/public/cpp/window.h"
#include "services/ui/public/cpp/window_tree_client.h"
+#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/event.h"
#include "ui/views/mus/native_widget_mus.h"
@@ -128,9 +129,15 @@ PointerWatcherEventRouter::DetermineEventTypes() {
void PointerWatcherEventRouter::OnWindowTreeCaptureChanged(
ui::Window* gained_capture,
ui::Window* lost_capture) {
- FOR_EACH_OBSERVER(PointerWatcher, move_watchers_, OnMouseCaptureChanged());
+ const ui::MouseEvent mouse_event(ui::ET_MOUSE_CAPTURE_CHANGED, gfx::Point(),
+ gfx::Point(), ui::EventTimeForNow(), 0, 0);
+ const ui::PointerEvent event(mouse_event);
+ gfx::Point location_in_screen =
+ display::Screen::GetScreen()->GetCursorScreenPoint();
+ FOR_EACH_OBSERVER(PointerWatcher, move_watchers_,
+ OnPointerEventObserved(event, location_in_screen, nullptr));
FOR_EACH_OBSERVER(PointerWatcher, non_move_watchers_,
- OnMouseCaptureChanged());
+ OnPointerEventObserved(event, location_in_screen, nullptr));
}
void PointerWatcherEventRouter::OnDidDestroyClient(
« no previous file with comments | « ui/events/event_unittest.cc ('k') | ui/views/mus/pointer_watcher_event_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698