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/public/cpp/view_manager/lib/view_manager_synchronizer.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/public/cpp/application/connect.h" | 9 #include "mojo/public/cpp/application/connect.h" |
10 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 10 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // ViewManagerSynchronizer, IViewManagerClient implementation: | 553 // ViewManagerSynchronizer, IViewManagerClient implementation: |
554 | 554 |
555 void ViewManagerSynchronizer::OnViewManagerConnectionEstablished( | 555 void ViewManagerSynchronizer::OnViewManagerConnectionEstablished( |
556 TransportConnectionId connection_id, | 556 TransportConnectionId connection_id, |
557 TransportChangeId next_server_change_id, | 557 TransportChangeId next_server_change_id, |
558 mojo::Array<INodePtr> nodes) { | 558 mojo::Array<INodePtr> nodes) { |
559 connected_ = true; | 559 connected_ = true; |
560 connection_id_ = connection_id; | 560 connection_id_ = connection_id; |
561 next_server_change_id_ = next_server_change_id; | 561 next_server_change_id_ = next_server_change_id; |
562 | 562 |
563 ViewManagerPrivate(view_manager()).set_root( | 563 ViewManagerPrivate private_manager(view_manager()); |
564 BuildNodeTree(view_manager(), nodes)); | 564 private_manager.set_root(BuildNodeTree(view_manager(), nodes)); |
565 | |
566 Sync(); | 565 Sync(); |
567 | 566 private_manager.NotifyReady(); |
568 base::MessageLoop::current()->Quit(); | |
569 } | 567 } |
570 | 568 |
571 void ViewManagerSynchronizer::OnServerChangeIdAdvanced( | 569 void ViewManagerSynchronizer::OnServerChangeIdAdvanced( |
572 uint32_t next_server_change_id) { | 570 uint32_t next_server_change_id) { |
573 next_server_change_id_ = next_server_change_id; | 571 next_server_change_id_ = next_server_change_id; |
574 } | 572 } |
575 | 573 |
576 void ViewManagerSynchronizer::OnNodeBoundsChanged(uint32 node_id, | 574 void ViewManagerSynchronizer::OnNodeBoundsChanged(uint32 node_id, |
577 RectPtr old_bounds, | 575 RectPtr old_bounds, |
578 RectPtr new_bounds) { | 576 RectPtr new_bounds) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 void ViewManagerSynchronizer::RemoveFromPendingQueue( | 652 void ViewManagerSynchronizer::RemoveFromPendingQueue( |
655 ViewManagerTransaction* transaction) { | 653 ViewManagerTransaction* transaction) { |
656 DCHECK_EQ(transaction, pending_transactions_.front()); | 654 DCHECK_EQ(transaction, pending_transactions_.front()); |
657 pending_transactions_.erase(pending_transactions_.begin()); | 655 pending_transactions_.erase(pending_transactions_.begin()); |
658 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) | 656 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) |
659 changes_acked_callback_.Run(); | 657 changes_acked_callback_.Run(); |
660 } | 658 } |
661 | 659 |
662 } // namespace view_manager | 660 } // namespace view_manager |
663 } // namespace mojo | 661 } // namespace mojo |
OLD | NEW |