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_client_impl.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.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/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
10 #include "mojo/public/cpp/application/connect.h" | 10 #include "mojo/public/cpp/application/connect.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 Id node_id, | 471 Id node_id, |
472 ViewManagerClientImpl* client) | 472 ViewManagerClientImpl* client) |
473 : ViewManagerTransaction(client), | 473 : ViewManagerTransaction(client), |
474 url_(url), | 474 url_(url), |
475 node_id_(node_id) {} | 475 node_id_(node_id) {} |
476 virtual ~EmbedTransaction() {} | 476 virtual ~EmbedTransaction() {} |
477 | 477 |
478 private: | 478 private: |
479 // Overridden from ViewManagerTransaction: | 479 // Overridden from ViewManagerTransaction: |
480 virtual void DoCommit() OVERRIDE { | 480 virtual void DoCommit() OVERRIDE { |
481 std::vector<Id> ids; | 481 service()->Embed(url_, node_id_, ActionCompletedCallback()); |
482 ids.push_back(node_id_); | |
483 service()->Embed(url_, Array<Id>::From(ids), ActionCompletedCallback()); | |
484 } | 482 } |
485 virtual void DoActionCompleted(bool success) OVERRIDE { | 483 virtual void DoActionCompleted(bool success) OVERRIDE { |
486 // TODO(beng): recovery? | 484 // TODO(beng): recovery? |
487 } | 485 } |
488 | 486 |
489 const String url_; | 487 const String url_; |
490 const Id node_id_; | 488 const Id node_id_; |
491 | 489 |
492 DISALLOW_COPY_AND_ASSIGN(EmbedTransaction); | 490 DISALLOW_COPY_AND_ASSIGN(EmbedTransaction); |
493 }; | 491 }; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 Array<NodeDataPtr> nodes) { | 736 Array<NodeDataPtr> nodes) { |
739 connected_ = true; | 737 connected_ = true; |
740 connection_id_ = connection_id; | 738 connection_id_ = connection_id; |
741 creator_url_ = TypeConverter<String, std::string>::ConvertFrom(creator_url); | 739 creator_url_ = TypeConverter<String, std::string>::ConvertFrom(creator_url); |
742 next_server_change_id_ = next_server_change_id; | 740 next_server_change_id_ = next_server_change_id; |
743 | 741 |
744 DCHECK(pending_transactions_.empty()); | 742 DCHECK(pending_transactions_.empty()); |
745 AddRoot(BuildNodeTree(this, nodes)); | 743 AddRoot(BuildNodeTree(this, nodes)); |
746 } | 744 } |
747 | 745 |
748 void ViewManagerClientImpl::OnRootsAdded(Array<NodeDataPtr> nodes) { | 746 void ViewManagerClientImpl::OnRootAdded(Array<NodeDataPtr> nodes) { |
749 AddRoot(BuildNodeTree(this, nodes)); | 747 AddRoot(BuildNodeTree(this, nodes)); |
750 } | 748 } |
751 | 749 |
752 void ViewManagerClientImpl::OnServerChangeIdAdvanced( | 750 void ViewManagerClientImpl::OnServerChangeIdAdvanced( |
753 Id next_server_change_id) { | 751 Id next_server_change_id) { |
754 next_server_change_id_ = next_server_change_id; | 752 next_server_change_id_ = next_server_change_id; |
755 } | 753 } |
756 | 754 |
757 void ViewManagerClientImpl::OnNodeBoundsChanged(Id node_id, | 755 void ViewManagerClientImpl::OnNodeBoundsChanged(Id node_id, |
758 RectPtr old_bounds, | 756 RectPtr old_bounds, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 908 |
911 // static | 909 // static |
912 void ViewManager::ConfigureIncomingConnection( | 910 void ViewManager::ConfigureIncomingConnection( |
913 ApplicationConnection* connection, | 911 ApplicationConnection* connection, |
914 ViewManagerDelegate* delegate) { | 912 ViewManagerDelegate* delegate) { |
915 connection->AddService<ViewManagerClientImpl>(delegate); | 913 connection->AddService<ViewManagerClientImpl>(delegate); |
916 } | 914 } |
917 | 915 |
918 } // namespace view_manager | 916 } // namespace view_manager |
919 } // namespace mojo | 917 } // namespace mojo |
OLD | NEW |