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

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

Issue 1991973003: mash: Preliminary support for widget hit test masks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 void WindowTreeClientImpl::SetClientArea( 306 void WindowTreeClientImpl::SetClientArea(
307 Id window_id, 307 Id window_id,
308 const gfx::Insets& client_area, 308 const gfx::Insets& client_area,
309 const std::vector<gfx::Rect>& additional_client_areas) { 309 const std::vector<gfx::Rect>& additional_client_areas) {
310 DCHECK(tree_); 310 DCHECK(tree_);
311 tree_->SetClientArea( 311 tree_->SetClientArea(
312 window_id, mojo::Insets::From(client_area), 312 window_id, mojo::Insets::From(client_area),
313 mojo::Array<mojo::RectPtr>::From(additional_client_areas)); 313 mojo::Array<mojo::RectPtr>::From(additional_client_areas));
314 } 314 }
315 315
316 void WindowTreeClientImpl::SetHitTestMask(Id window_id, const gfx::Rect& mask) {
317 DCHECK(tree_);
318 tree_->SetHitTestMask(window_id, mojo::Rect::From(mask));
319 }
320
321 void WindowTreeClientImpl::ClearHitTestMask(Id window_id) {
322 DCHECK(tree_);
323 tree_->SetHitTestMask(window_id, nullptr);
324 }
325
316 void WindowTreeClientImpl::SetFocus(Window* window) { 326 void WindowTreeClientImpl::SetFocus(Window* window) {
317 // In order for us to get here we had to have exposed a window, which implies 327 // In order for us to get here we had to have exposed a window, which implies
318 // we got a connection. 328 // we got a connection.
319 DCHECK(tree_); 329 DCHECK(tree_);
320 const uint32_t change_id = ScheduleInFlightChange( 330 const uint32_t change_id = ScheduleInFlightChange(
321 base::WrapUnique(new InFlightFocusChange(this, focused_window_))); 331 base::WrapUnique(new InFlightFocusChange(this, focused_window_)));
322 tree_->SetFocus(change_id, window ? server_id(window) : 0); 332 tree_->SetFocus(change_id, window ? server_id(window) : 0);
323 LocalSetFocus(window); 333 LocalSetFocus(window);
324 } 334 }
325 335
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 const gfx::Vector2d& offset, 1138 const gfx::Vector2d& offset,
1129 const gfx::Insets& hit_area) { 1139 const gfx::Insets& hit_area) {
1130 if (window_manager_internal_client_) { 1140 if (window_manager_internal_client_) {
1131 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( 1141 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
1132 server_id(window), offset.x(), offset.y(), 1142 server_id(window), offset.x(), offset.y(),
1133 mojo::Insets::From(hit_area)); 1143 mojo::Insets::From(hit_area));
1134 } 1144 }
1135 } 1145 }
1136 1146
1137 } // namespace mus 1147 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/window_tree_client_impl.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