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/application.h" | 9 #include "mojo/public/cpp/application/application.h" |
10 #include "mojo/public/cpp/application/connect.h" | 10 #include "mojo/public/cpp/application/connect.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 : ViewManagerTransaction(TYPE_EMBED, synchronizer), | 441 : ViewManagerTransaction(TYPE_EMBED, synchronizer), |
442 url_(url), | 442 url_(url), |
443 node_id_(node_id) {} | 443 node_id_(node_id) {} |
444 virtual ~EmbedTransaction() {} | 444 virtual ~EmbedTransaction() {} |
445 | 445 |
446 private: | 446 private: |
447 // Overridden from ViewManagerTransaction: | 447 // Overridden from ViewManagerTransaction: |
448 virtual void DoCommit() OVERRIDE { | 448 virtual void DoCommit() OVERRIDE { |
449 std::vector<Id> ids; | 449 std::vector<Id> ids; |
450 ids.push_back(node_id_); | 450 ids.push_back(node_id_); |
451 service()->Connect(url_, Array<Id>::From(ids), | 451 service()->Embed(url_, Array<Id>::From(ids), ActionCompletedCallback()); |
452 ActionCompletedCallback()); | |
453 } | 452 } |
454 virtual void DoActionCompleted(bool success) OVERRIDE { | 453 virtual void DoActionCompleted(bool success) OVERRIDE { |
455 // TODO(beng): recovery? | 454 // TODO(beng): recovery? |
456 } | 455 } |
457 | 456 |
458 const String url_; | 457 const String url_; |
459 const Id node_id_; | 458 const Id node_id_; |
460 | 459 |
461 DISALLOW_COPY_AND_ASSIGN(EmbedTransaction); | 460 DISALLOW_COPY_AND_ASSIGN(EmbedTransaction); |
462 }; | 461 }; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 // ViewManager, public: | 765 // ViewManager, public: |
767 | 766 |
768 // static | 767 // static |
769 void ViewManager::Create(Application* application, | 768 void ViewManager::Create(Application* application, |
770 ViewManagerDelegate* delegate) { | 769 ViewManagerDelegate* delegate) { |
771 application->AddService<ViewManagerSynchronizer>(delegate); | 770 application->AddService<ViewManagerSynchronizer>(delegate); |
772 } | 771 } |
773 | 772 |
774 } // namespace view_manager | 773 } // namespace view_manager |
775 } // namespace mojo | 774 } // namespace mojo |
OLD | NEW |