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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 if (!node) { | 743 if (!node) { |
744 callback.Run(false); | 744 callback.Run(false); |
745 return; | 745 return; |
746 } | 746 } |
747 | 747 |
748 RootNodeManager::ScopedChange change( | 748 RootNodeManager::ScopedChange change( |
749 this, root_node_manager_, | 749 this, root_node_manager_, |
750 RootNodeManager::CHANGE_TYPE_DONT_ADVANCE_SERVER_CHANGE_ID, false); | 750 RootNodeManager::CHANGE_TYPE_DONT_ADVANCE_SERVER_CHANGE_ID, false); |
751 gfx::Rect old_bounds = node->window()->bounds(); | 751 gfx::Rect old_bounds = node->window()->bounds(); |
752 node->window()->SetBounds(bounds.To<gfx::Rect>()); | 752 node->window()->SetBounds(bounds.To<gfx::Rect>()); |
753 root_node_manager_->ProcessNodeBoundsChanged( | |
754 node, old_bounds, bounds.To<gfx::Rect>()); | |
755 callback.Run(true); | 753 callback.Run(true); |
756 } | 754 } |
757 | 755 |
758 void ViewManagerServiceImpl::SetNodeVisibility( | 756 void ViewManagerServiceImpl::SetNodeVisibility( |
759 Id transport_node_id, | 757 Id transport_node_id, |
760 bool visible, | 758 bool visible, |
761 const Callback<void(bool)>& callback) { | 759 const Callback<void(bool)>& callback) { |
762 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); | 760 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); |
763 Node* node = GetNode(node_id); | 761 Node* node = GetNode(node_id); |
764 const bool success = CanSetNodeVisibility(node, visible); | 762 const bool success = CanSetNodeVisibility(node, visible); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 base::Bind(&base::DoNothing)); | 801 base::Bind(&base::DoNothing)); |
804 } | 802 } |
805 } | 803 } |
806 | 804 |
807 void ViewManagerServiceImpl::OnNodeHierarchyChanged(const Node* node, | 805 void ViewManagerServiceImpl::OnNodeHierarchyChanged(const Node* node, |
808 const Node* new_parent, | 806 const Node* new_parent, |
809 const Node* old_parent) { | 807 const Node* old_parent) { |
810 root_node_manager_->ProcessNodeHierarchyChanged(node, new_parent, old_parent); | 808 root_node_manager_->ProcessNodeHierarchyChanged(node, new_parent, old_parent); |
811 } | 809 } |
812 | 810 |
| 811 void ViewManagerServiceImpl::OnNodeBoundsChanged(const Node* node, |
| 812 const gfx::Rect& old_bounds, |
| 813 const gfx::Rect& new_bounds) { |
| 814 root_node_manager_->ProcessNodeBoundsChanged(node, old_bounds, new_bounds); |
| 815 } |
| 816 |
813 void ViewManagerServiceImpl::OnNodeViewReplaced(const Node* node, | 817 void ViewManagerServiceImpl::OnNodeViewReplaced(const Node* node, |
814 const View* new_view, | 818 const View* new_view, |
815 const View* old_view) { | 819 const View* old_view) { |
816 root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view); | 820 root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view); |
817 } | 821 } |
818 | 822 |
819 void ViewManagerServiceImpl::OnViewInputEvent(const View* view, | 823 void ViewManagerServiceImpl::OnViewInputEvent(const View* view, |
820 const ui::Event* event) { | 824 const ui::Event* event) { |
821 root_node_manager_->DispatchViewInputEventToWindowManager(view, event); | 825 root_node_manager_->DispatchViewInputEventToWindowManager(view, event); |
822 } | 826 } |
(...skipping 12 matching lines...) Expand all Loading... |
835 client()->OnViewManagerConnectionEstablished( | 839 client()->OnViewManagerConnectionEstablished( |
836 id_, | 840 id_, |
837 creator_url_, | 841 creator_url_, |
838 root_node_manager_->next_server_change_id(), | 842 root_node_manager_->next_server_change_id(), |
839 NodesToNodeDatas(to_send)); | 843 NodesToNodeDatas(to_send)); |
840 } | 844 } |
841 | 845 |
842 } // namespace service | 846 } // namespace service |
843 } // namespace view_manager | 847 } // namespace view_manager |
844 } // namespace mojo | 848 } // namespace mojo |
OLD | NEW |