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

Side by Side Diff: components/mus/ws/window_tree.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
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | ui/views/mus/native_widget_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ws/window_tree.h" 5 #include "components/mus/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 ServerWindow* window = 1294 ServerWindow* window =
1295 GetWindowByClientId(ClientWindowId(transport_window_id)); 1295 GetWindowByClientId(ClientWindowId(transport_window_id));
1296 if (!window || !access_policy_->CanSetClientArea(window)) 1296 if (!window || !access_policy_->CanSetClientArea(window))
1297 return; 1297 return;
1298 1298
1299 std::vector<gfx::Rect> additional_client_areas = 1299 std::vector<gfx::Rect> additional_client_areas =
1300 transport_additional_client_areas.To<std::vector<gfx::Rect>>(); 1300 transport_additional_client_areas.To<std::vector<gfx::Rect>>();
1301 window->SetClientArea(insets.To<gfx::Insets>(), additional_client_areas); 1301 window->SetClientArea(insets.To<gfx::Insets>(), additional_client_areas);
1302 } 1302 }
1303 1303
1304 void WindowTree::SetHitTestMask(Id transport_window_id, mojo::RectPtr mask) {
1305 ServerWindow* window =
1306 GetWindowByClientId(ClientWindowId(transport_window_id));
1307 if (!window || !access_policy_->CanSetHitTestMask(window)) {
1308 DVLOG(1) << "SetHitTestMask failed";
1309 return;
1310 }
1311
1312 if (mask)
1313 window->SetHitTestMask(mask.To<gfx::Rect>());
1314 else
1315 window->ClearHitTestMask();
1316 }
1317
1304 void WindowTree::Embed(Id transport_window_id, 1318 void WindowTree::Embed(Id transport_window_id,
1305 mojom::WindowTreeClientPtr client, 1319 mojom::WindowTreeClientPtr client,
1306 const EmbedCallback& callback) { 1320 const EmbedCallback& callback) {
1307 callback.Run(Embed(ClientWindowId(transport_window_id), std::move(client))); 1321 callback.Run(Embed(ClientWindowId(transport_window_id), std::move(client)));
1308 } 1322 }
1309 1323
1310 void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) { 1324 void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) {
1311 client()->OnChangeCompleted(change_id, 1325 client()->OnChangeCompleted(change_id,
1312 SetFocus(ClientWindowId(transport_window_id))); 1326 SetFocus(ClientWindowId(transport_window_id)));
1313 } 1327 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 } 1479 }
1466 1480
1467 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1481 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1468 const ServerWindow* window) const { 1482 const ServerWindow* window) const {
1469 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1483 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1470 return tree && tree != this; 1484 return tree && tree != this;
1471 } 1485 }
1472 1486
1473 } // namespace ws 1487 } // namespace ws
1474 } // namespace mus 1488 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | ui/views/mus/native_widget_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698