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

Unified Diff: mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc

Issue 954273002: Routes WindowManager functionality through the view manager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: comments Created 5 years, 10 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: mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc
diff --git a/mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc b/mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc
index 9a3c022d86a3a104b2d6ad42a0095a743d17a0bf..b0d4b33b09e3040aa2142b2f02bca58335f68d26 100644
--- a/mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc
+++ b/mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc
@@ -172,8 +172,8 @@ void ViewManagerClientImpl::SetSurfaceId(Id view_id, SurfaceIdPtr surface_id) {
void ViewManagerClientImpl::SetFocus(Id view_id) {
// In order for us to get here we had to have exposed a view, which implies we
// got a connection.
- DCHECK(window_manager_.get());
- window_manager_->FocusWindow(view_id, ActionCompletedCallback());
+ DCHECK(service_);
+ service_->PerformAction(view_id, "focus", ActionCompletedCallback());
}
void ViewManagerClientImpl::SetVisible(Id view_id, bool visible) {
@@ -418,6 +418,14 @@ void ViewManagerClientImpl::OnViewInputEvent(
ack_callback.Run();
}
+void ViewManagerClientImpl::OnPerformAction(
+ Id view_id,
+ const String& name,
+ const Callback<void(bool)>& callback) {
+ View* view = GetViewById(view_id);
+ callback.Run(delegate_->OnPerformAction(view, name));
+}
+
////////////////////////////////////////////////////////////////////////////////
// ViewManagerClientImpl, WindowManagerObserver implementation:

Powered by Google App Engine
This is Rietveld 408576698