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

Side by Side Diff: components/view_manager/view_manager_service_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: Yet anther rebase (YAR!!!) 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/view_manager_service_impl.h" 5 #include "components/view_manager/view_manager_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "components/view_manager/connection_manager.h" 9 #include "components/view_manager/connection_manager.h"
10 #include "components/view_manager/default_access_policy.h" 10 #include "components/view_manager/default_access_policy.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 if (value.is_null()) { 707 if (value.is_null()) {
708 view->SetProperty(name, nullptr); 708 view->SetProperty(name, nullptr);
709 } else { 709 } else {
710 std::vector<uint8_t> data = value.To<std::vector<uint8_t>>(); 710 std::vector<uint8_t> data = value.To<std::vector<uint8_t>>();
711 view->SetProperty(name, &data); 711 view->SetProperty(name, &data);
712 } 712 }
713 } 713 }
714 callback.Run(success); 714 callback.Run(success);
715 } 715 }
716 716
717 void ViewManagerServiceImpl::RequestCompositorFrameReceiver(
718 mojo::Id view_id,
719 mojo::InterfaceRequest<mojo::CompositorFrameReceiver> receiver) {
720 ServerView* view = GetView(ViewIdFromTransportId(view_id));
721 const bool success = view && access_policy_->CanSetViewSurfaceId(view);
722 if (!success)
723 return;
724 view->Bind(receiver.Pass());
725 }
726
717 void ViewManagerServiceImpl::SetViewTextInputState( 727 void ViewManagerServiceImpl::SetViewTextInputState(
718 uint32_t view_id, 728 uint32_t view_id,
719 mojo::TextInputStatePtr state) { 729 mojo::TextInputStatePtr state) {
720 ServerView* view = GetView(ViewIdFromTransportId(view_id)); 730 ServerView* view = GetView(ViewIdFromTransportId(view_id));
721 bool success = view && access_policy_->CanSetViewTextInputState(view); 731 bool success = view && access_policy_->CanSetViewTextInputState(view);
722 if (success) 732 if (success)
723 view->SetTextInputState(state.To<ui::TextInputState>()); 733 view->SetTextInputState(state.To<ui::TextInputState>());
724 } 734 }
725 735
726 void ViewManagerServiceImpl::SetImeVisibility(uint32_t view_id, 736 void ViewManagerServiceImpl::SetImeVisibility(uint32_t view_id,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 ViewManagerServiceImpl* connection = 788 ViewManagerServiceImpl* connection =
779 connection_manager_->GetConnectionWithRoot(view->id()); 789 connection_manager_->GetConnectionWithRoot(view->id());
780 return connection && connection != this; 790 return connection && connection != this;
781 } 791 }
782 792
783 bool ViewManagerServiceImpl::IsDescendantOfEmbedRoot(const ServerView* view) { 793 bool ViewManagerServiceImpl::IsDescendantOfEmbedRoot(const ServerView* view) {
784 return is_embed_root_ && root_ && GetView(*root_)->Contains(view); 794 return is_embed_root_ && root_ && GetView(*root_)->Contains(view);
785 } 795 }
786 796
787 } // namespace view_manager 797 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698