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

Side by Side Diff: components/view_manager/public/cpp/lib/view_manager_client_impl.cc

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 4 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/view_manager/public/cpp/lib/view_manager_client_impl.h" 5 #include "components/view_manager/public/cpp/lib/view_manager_client_impl.h"
6 6
7 #include "components/view_manager/public/cpp/lib/view_private.h" 7 #include "components/view_manager/public/cpp/lib/view_private.h"
8 #include "components/view_manager/public/cpp/util.h" 8 #include "components/view_manager/public/cpp/util.h"
9 #include "components/view_manager/public/cpp/view_manager_delegate.h" 9 #include "components/view_manager/public/cpp/view_manager_delegate.h"
10 #include "components/view_manager/public/cpp/view_observer.h" 10 #include "components/view_manager/public/cpp/view_observer.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 service_->Embed(view_id, client.Pass(), ActionCompletedCallback()); 190 service_->Embed(view_id, client.Pass(), ActionCompletedCallback());
191 } 191 }
192 192
193 void ViewManagerClientImpl::EmbedAllowingReembed(mojo::URLRequestPtr request, 193 void ViewManagerClientImpl::EmbedAllowingReembed(mojo::URLRequestPtr request,
194 Id view_id) { 194 Id view_id) {
195 DCHECK(service_); 195 DCHECK(service_);
196 service_->EmbedAllowingReembed(view_id, request.Pass(), 196 service_->EmbedAllowingReembed(view_id, request.Pass(),
197 ActionCompletedCallback()); 197 ActionCompletedCallback());
198 } 198 }
199 199
200 void ViewManagerClientImpl::RequestCompositorFrameReceiver(
201 Id view_id,
202 InterfaceRequest<CompositorFrameReceiver> receiver) {
203 DCHECK(service_);
204 service_->RequestCompositorFrameReceiver(view_id, receiver.Pass());
205 }
206
200 void ViewManagerClientImpl::AddView(View* view) { 207 void ViewManagerClientImpl::AddView(View* view) {
201 DCHECK(views_.find(view->id()) == views_.end()); 208 DCHECK(views_.find(view->id()) == views_.end());
202 views_[view->id()] = view; 209 views_[view->id()] = view;
203 } 210 }
204 211
205 void ViewManagerClientImpl::RemoveView(Id view_id) { 212 void ViewManagerClientImpl::RemoveView(Id view_id) {
206 if (focused_view_ && focused_view_->id() == view_id) 213 if (focused_view_ && focused_view_->id() == view_id)
207 OnViewFocused(0); 214 OnViewFocused(0);
208 215
209 IdToViewMap::iterator it = views_.find(view_id); 216 IdToViewMap::iterator it = views_.find(view_id);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 void ViewManagerClientImpl::OnActionCompleted(bool success) { 437 void ViewManagerClientImpl::OnActionCompleted(bool success) {
431 if (!change_acked_callback_.is_null()) 438 if (!change_acked_callback_.is_null())
432 change_acked_callback_.Run(); 439 change_acked_callback_.Run();
433 } 440 }
434 441
435 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() { 442 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() {
436 return [this](bool success) { OnActionCompleted(success); }; 443 return [this](bool success) { OnActionCompleted(success); };
437 } 444 }
438 445
439 } // namespace mojo 446 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698