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

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

Issue 1749323002: Update WindowTree::OnWindowInputEventAck to include handled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing Component Build DEPS Created 4 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
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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 return; 813 return;
814 814
815 WindowPrivate(window).LocalSetSharedProperty(name, std::move(new_data)); 815 WindowPrivate(window).LocalSetSharedProperty(name, std::move(new_data));
816 } 816 }
817 817
818 void WindowTreeClientImpl::OnWindowInputEvent(uint32_t event_id, 818 void WindowTreeClientImpl::OnWindowInputEvent(uint32_t event_id,
819 Id window_id, 819 Id window_id,
820 mojom::EventPtr event) { 820 mojom::EventPtr event) {
821 Window* window = GetWindowById(window_id); 821 Window* window = GetWindowById(window_id);
822 if (!window || !window->input_event_handler_) { 822 if (!window || !window->input_event_handler_) {
823 tree_->OnWindowInputEventAck(event_id); 823 tree_->OnWindowInputEventAck(event_id, false);
824 return; 824 return;
825 } 825 }
826 826
827 scoped_ptr<base::Closure> ack_callback( 827 scoped_ptr<base::Callback<void(bool)>> ack_callback(
828 new base::Closure(base::Bind(&mojom::WindowTree::OnWindowInputEventAck, 828 new base::Callback<void(bool)>(
829 base::Unretained(tree_), event_id))); 829 base::Bind(&mojom::WindowTree::OnWindowInputEventAck,
830 base::Unretained(tree_), event_id)));
830 window->input_event_handler_->OnWindowInputEvent(window, std::move(event), 831 window->input_event_handler_->OnWindowInputEvent(window, std::move(event),
831 &ack_callback); 832 &ack_callback);
833
834 // The handler did not take ownership of the callback, so we send the ack,
835 // marking the event as not consumed.
832 if (ack_callback) 836 if (ack_callback)
833 ack_callback->Run(); 837 ack_callback->Run(false);
834 } 838 }
835 839
836 void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) { 840 void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) {
837 Window* focused_window = GetWindowById(focused_window_id); 841 Window* focused_window = GetWindowById(focused_window_id);
838 InFlightFocusChange new_change(this, focused_window); 842 InFlightFocusChange new_change(this, focused_window);
839 if (ApplyServerChangeToExistingInFlightChange(new_change)) 843 if (ApplyServerChangeToExistingInFlightChange(new_change))
840 return; 844 return;
841 845
842 LocalSetFocus(focused_window); 846 LocalSetFocus(focused_window);
843 } 847 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 983
980 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( 984 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea(
981 Window* window, 985 Window* window,
982 const gfx::Vector2d& offset, 986 const gfx::Vector2d& offset,
983 const gfx::Insets& hit_area) { 987 const gfx::Insets& hit_area) {
984 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 988 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
985 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); 989 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area));
986 } 990 }
987 991
988 } // namespace mus 992 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/public/cpp/input_event_handler.h ('k') | components/mus/public/cpp/tests/test_window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698