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

Side by Side Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1909733002: mus: Add EventObserver to allow passively listening to UI events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/mus/public/cpp/lib/window_tree_client_impl.h" 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 base::Unretained(tree_), event_id))); 878 base::Unretained(tree_), event_id)));
879 window->input_event_handler_->OnWindowInputEvent( 879 window->input_event_handler_->OnWindowInputEvent(
880 window, *event.To<scoped_ptr<ui::Event>>().get(), &ack_callback); 880 window, *event.To<scoped_ptr<ui::Event>>().get(), &ack_callback);
881 881
882 // The handler did not take ownership of the callback, so we send the ack, 882 // The handler did not take ownership of the callback, so we send the ack,
883 // marking the event as not consumed. 883 // marking the event as not consumed.
884 if (ack_callback) 884 if (ack_callback)
885 ack_callback->Run(mojom::EventResult::UNHANDLED); 885 ack_callback->Run(mojom::EventResult::UNHANDLED);
886 } 886 }
887 887
888 void WindowTreeClientImpl::OnEventObserved(mojom::EventPtr event_in) {
889 // TODO(jamescook): Route the observed event to PointerWatchers.
890 }
891
888 void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) { 892 void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) {
889 Window* focused_window = GetWindowByServerId(focused_window_id); 893 Window* focused_window = GetWindowByServerId(focused_window_id);
890 InFlightFocusChange new_change(this, focused_window); 894 InFlightFocusChange new_change(this, focused_window);
891 if (ApplyServerChangeToExistingInFlightChange(new_change)) 895 if (ApplyServerChangeToExistingInFlightChange(new_change))
892 return; 896 return;
893 897
894 LocalSetFocus(focused_window); 898 LocalSetFocus(focused_window);
895 } 899 }
896 900
897 void WindowTreeClientImpl::OnWindowPredefinedCursorChanged( 901 void WindowTreeClientImpl::OnWindowPredefinedCursorChanged(
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 1036
1033 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( 1037 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea(
1034 Window* window, 1038 Window* window,
1035 const gfx::Vector2d& offset, 1039 const gfx::Vector2d& offset,
1036 const gfx::Insets& hit_area) { 1040 const gfx::Insets& hit_area) {
1037 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 1041 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
1038 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area)); 1042 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area));
1039 } 1043 }
1040 1044
1041 } // namespace mus 1045 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698