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

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

Issue 1881253002: mus: Implement ScreenMus::GetCursorScreenPoint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test mocks too 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"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/threading/thread_restrictions.h"
12 #include "components/mus/common/util.h" 13 #include "components/mus/common/util.h"
13 #include "components/mus/public/cpp/input_event_handler.h" 14 #include "components/mus/public/cpp/input_event_handler.h"
14 #include "components/mus/public/cpp/lib/in_flight_change.h" 15 #include "components/mus/public/cpp/lib/in_flight_change.h"
15 #include "components/mus/public/cpp/lib/window_private.h" 16 #include "components/mus/public/cpp/lib/window_private.h"
16 #include "components/mus/public/cpp/window_manager_delegate.h" 17 #include "components/mus/public/cpp/window_manager_delegate.h"
17 #include "components/mus/public/cpp/window_observer.h" 18 #include "components/mus/public/cpp/window_observer.h"
18 #include "components/mus/public/cpp/window_tracker.h" 19 #include "components/mus/public/cpp/window_tracker.h"
19 #include "components/mus/public/cpp/window_tree_connection.h" 20 #include "components/mus/public/cpp/window_tree_connection.h"
20 #include "components/mus/public/cpp/window_tree_connection_observer.h" 21 #include "components/mus/public/cpp/window_tree_connection_observer.h"
21 #include "components/mus/public/cpp/window_tree_delegate.h" 22 #include "components/mus/public/cpp/window_tree_delegate.h"
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 void WindowTreeClientImpl::OnWindowDeleted(Id window_id) { 808 void WindowTreeClientImpl::OnWindowDeleted(Id window_id) {
808 Window* window = GetWindowByServerId(window_id); 809 Window* window = GetWindowByServerId(window_id);
809 if (window) 810 if (window)
810 WindowPrivate(window).LocalDestroy(); 811 WindowPrivate(window).LocalDestroy();
811 } 812 }
812 813
813 Window* WindowTreeClientImpl::GetCaptureWindow() { 814 Window* WindowTreeClientImpl::GetCaptureWindow() {
814 return capture_window_; 815 return capture_window_;
815 } 816 }
816 817
818 gfx::Point WindowTreeClientImpl::GetCursorScreenPoint() {
819 base::ThreadRestrictions::ScopedAllowWait allow_wait;
sky 2016/04/18 15:09:11 Add a TODO that this code should use the location
820 mojo::PointPtr p;
821 tree_ptr_->GetCursorScreenPoint(&p);
822 return p.To<gfx::Point>();
823 }
824
817 void WindowTreeClientImpl::OnWindowVisibilityChanged(Id window_id, 825 void WindowTreeClientImpl::OnWindowVisibilityChanged(Id window_id,
818 bool visible) { 826 bool visible) {
819 Window* window = GetWindowByServerId(window_id); 827 Window* window = GetWindowByServerId(window_id);
820 if (!window) 828 if (!window)
821 return; 829 return;
822 830
823 InFlightVisibleChange new_change(window, visible); 831 InFlightVisibleChange new_change(window, visible);
824 if (ApplyServerChangeToExistingInFlightChange(new_change)) 832 if (ApplyServerChangeToExistingInFlightChange(new_change))
825 return; 833 return;
826 834
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 1040
1033 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( 1041 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea(
1034 Window* window, 1042 Window* window,
1035 const gfx::Vector2d& offset, 1043 const gfx::Vector2d& offset,
1036 const gfx::Insets& hit_area) { 1044 const gfx::Insets& hit_area) {
1037 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 1045 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
1038 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area)); 1046 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area));
1039 } 1047 }
1040 1048
1041 } // namespace mus 1049 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698