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

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2878113002: mus: Embedder can request and observe BeginFrame for embedded client. (Closed)
Patch Set: . Created 3 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 "services/ui/ws/window_tree.h" 5 #include "services/ui/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 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 bool success = access_policy_->CanSetWindowBounds(window); 1566 bool success = access_policy_->CanSetWindowBounds(window);
1567 if (success) { 1567 if (success) {
1568 Operation op(this, window_server_, OperationType::SET_WINDOW_BOUNDS); 1568 Operation op(this, window_server_, OperationType::SET_WINDOW_BOUNDS);
1569 window->SetBounds(bounds, local_surface_id); 1569 window->SetBounds(bounds, local_surface_id);
1570 } else { 1570 } else {
1571 DVLOG(1) << "SetWindowBounds failed (access denied)"; 1571 DVLOG(1) << "SetWindowBounds failed (access denied)";
1572 } 1572 }
1573 client()->OnChangeCompleted(change_id, success); 1573 client()->OnChangeCompleted(change_id, success);
1574 } 1574 }
1575 1575
1576 void WindowTree::RequestBeginFrames(Id window_id,
1577 cc::mojom::FrameSinkObserverPtr observer) {
1578 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id));
1579 // This client must own |window_id| if it wants to be able to add a frame sink
1580 // observer.
1581 if (!window || window->id().client_id != id_)
1582 return;
1583 // This makes no sense if |window| is not embedding a client.
1584 if (!window_server_->GetTreeWithRoot(window))
1585 return;
1586 window->GetOrCreateCompositorFrameSinkManager()->RequestBeginFrames(
1587 std::move(observer));
1588 }
1589
1576 void WindowTree::SetWindowVisibility(uint32_t change_id, 1590 void WindowTree::SetWindowVisibility(uint32_t change_id,
1577 Id transport_window_id, 1591 Id transport_window_id,
1578 bool visible) { 1592 bool visible) {
1579 client()->OnChangeCompleted( 1593 client()->OnChangeCompleted(
1580 change_id, 1594 change_id,
1581 SetWindowVisibility(ClientWindowId(transport_window_id), visible)); 1595 SetWindowVisibility(ClientWindowId(transport_window_id), visible));
1582 } 1596 }
1583 1597
1584 void WindowTree::SetWindowProperty( 1598 void WindowTree::SetWindowProperty(
1585 uint32_t change_id, 1599 uint32_t change_id,
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2497 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2484 effect_bitmask, callback); 2498 effect_bitmask, callback);
2485 } 2499 }
2486 2500
2487 void WindowTree::PerformOnDragDropDone() { 2501 void WindowTree::PerformOnDragDropDone() {
2488 client()->OnDragDropDone(); 2502 client()->OnDragDropDone();
2489 } 2503 }
2490 2504
2491 } // namespace ws 2505 } // namespace ws
2492 } // namespace ui 2506 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698