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

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: Added a TODO 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 OnViewEmbeddedAppDisconnected(view)); 304 OnViewEmbeddedAppDisconnected(view));
298 } 305 }
299 } 306 }
300 307
301 void ViewManagerClientImpl::OnUnembed() { 308 void ViewManagerClientImpl::OnUnembed() {
302 delegate_->OnUnembed(); 309 delegate_->OnUnembed();
303 // This will send out the various notifications. 310 // This will send out the various notifications.
304 delete this; 311 delete this;
305 } 312 }
306 313
314 void ViewManagerClientImpl::OnResourcesReturned(
315 mojo::Array<mojo::ReturnedResourcePtr> resources) {
316 delegate_->OnResourcesReturned(resources.Pass());
317 }
318
307 void ViewManagerClientImpl::OnViewBoundsChanged(Id view_id, 319 void ViewManagerClientImpl::OnViewBoundsChanged(Id view_id,
308 RectPtr old_bounds, 320 RectPtr old_bounds,
309 RectPtr new_bounds) { 321 RectPtr new_bounds) {
310 View* view = GetViewById(view_id); 322 View* view = GetViewById(view_id);
311 ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds); 323 ViewPrivate(view).LocalSetBounds(*old_bounds, *new_bounds);
312 } 324 }
313 325
314 namespace { 326 namespace {
315 327
316 void SetViewportMetricsOnDecendants(View* root, 328 void SetViewportMetricsOnDecendants(View* root,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 void ViewManagerClientImpl::OnActionCompleted(bool success) { 449 void ViewManagerClientImpl::OnActionCompleted(bool success) {
438 if (!change_acked_callback_.is_null()) 450 if (!change_acked_callback_.is_null())
439 change_acked_callback_.Run(); 451 change_acked_callback_.Run();
440 } 452 }
441 453
442 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() { 454 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() {
443 return [this](bool success) { OnActionCompleted(success); }; 455 return [this](bool success) { OnActionCompleted(success); };
444 } 456 }
445 457
446 } // namespace mojo 458 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698