OLD | NEW |
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 "mojo/services/view_manager/view_manager_service_impl.h" | 5 #include "mojo/services/view_manager/view_manager_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 8 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
9 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 9 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
10 #include "mojo/services/view_manager/node.h" | 10 #include "mojo/services/view_manager/node.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 connection_by_url->AddRoot(node_id); | 746 connection_by_url->AddRoot(node_id); |
747 else | 747 else |
748 root_node_manager_->Embed(id_, url, transport_node_id); | 748 root_node_manager_->Embed(id_, url, transport_node_id); |
749 } else { | 749 } else { |
750 success = false; | 750 success = false; |
751 } | 751 } |
752 } | 752 } |
753 callback.Run(success); | 753 callback.Run(success); |
754 } | 754 } |
755 | 755 |
| 756 void ViewManagerServiceImpl::EmbedRoot(const String& url, |
| 757 const Callback<void(bool)>& callback) { |
| 758 root_node_manager_->EmbedRoot(url); |
| 759 callback.Run(true); |
| 760 } |
| 761 |
756 void ViewManagerServiceImpl::DispatchOnViewInputEvent(Id transport_view_id, | 762 void ViewManagerServiceImpl::DispatchOnViewInputEvent(Id transport_view_id, |
757 EventPtr event) { | 763 EventPtr event) { |
758 // We only allow the WM to dispatch events. At some point this function will | 764 // We only allow the WM to dispatch events. At some point this function will |
759 // move to a separate interface and the check can go away. | 765 // move to a separate interface and the check can go away. |
760 if (id_ != kWindowManagerConnection) | 766 if (id_ != kWindowManagerConnection) |
761 return; | 767 return; |
762 | 768 |
763 const ViewId view_id(ViewIdFromTransportId(transport_view_id)); | 769 const ViewId view_id(ViewIdFromTransportId(transport_view_id)); |
764 ViewManagerServiceImpl* connection = root_node_manager_->GetConnection( | 770 ViewManagerServiceImpl* connection = root_node_manager_->GetConnection( |
765 view_id.connection_id); | 771 view_id.connection_id); |
(...skipping 18 matching lines...) Expand all Loading... |
784 | 790 |
785 client()->OnViewManagerConnectionEstablished( | 791 client()->OnViewManagerConnectionEstablished( |
786 id_, | 792 id_, |
787 creator_url_, | 793 creator_url_, |
788 NodesToNodeDatas(to_send)); | 794 NodesToNodeDatas(to_send)); |
789 } | 795 } |
790 | 796 |
791 } // namespace service | 797 } // namespace service |
792 } // namespace view_manager | 798 } // namespace view_manager |
793 } // namespace mojo | 799 } // namespace mojo |
OLD | NEW |