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

Unified Diff: components/mus/view_tree_impl.cc

Issue 1352043005: mus: Implement Window Server Capture Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/mus/view_tree_impl.cc
diff --git a/components/mus/view_tree_impl.cc b/components/mus/view_tree_impl.cc
index b97583e1fbf1b804651bc5491cd63a145e011539..08f109770d064bd444e859945ce7a747805b46d3 100644
--- a/components/mus/view_tree_impl.cc
+++ b/components/mus/view_tree_impl.cc
@@ -318,6 +318,10 @@ void ViewTreeImpl::ProcessFocusChanged(const ServerView* old_focused_view,
: ViewIdToTransportId(ViewId()));
}
+void ViewTreeImpl::ProcessLostCapture(const ServerView* old_captured_view) {
+ client()->OnLostCapture(ViewIdToTransportId(old_captured_view->id()));
+}
+
bool ViewTreeImpl::IsViewKnown(const ServerView* view) const {
return known_views_.count(ViewIdToTransportId(view->id())) > 0;
}
@@ -567,6 +571,18 @@ void ViewTreeImpl::GetViewTree(
callback.Run(ViewsToViewDatas(views));
}
+void ViewTreeImpl::SetCapture(Id view_id,
+ const Callback<void(bool)>& callback) {
+ ServerView* view = GetView(ViewIdFromTransportId(view_id));
+ bool success = view && access_policy_->CanSetCapture(view);
+ if (success) {
+ ViewTreeHostImpl* host = GetHost();
+ if (host)
+ host->SetCapture(view);
+ }
+ callback.Run(success);
+}
+
void ViewTreeImpl::SetViewBounds(Id view_id,
mojo::RectPtr bounds,
const Callback<void(bool)>& callback) {

Powered by Google App Engine
This is Rietveld 408576698