| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 public: | 228 public: |
| 229 DestroyViewTreeNodeTransaction(Id node_id, | 229 DestroyViewTreeNodeTransaction(Id node_id, |
| 230 ViewManagerSynchronizer* synchronizer) | 230 ViewManagerSynchronizer* synchronizer) |
| 231 : ViewManagerTransaction(synchronizer), | 231 : ViewManagerTransaction(synchronizer), |
| 232 node_id_(node_id) {} | 232 node_id_(node_id) {} |
| 233 virtual ~DestroyViewTreeNodeTransaction() {} | 233 virtual ~DestroyViewTreeNodeTransaction() {} |
| 234 | 234 |
| 235 private: | 235 private: |
| 236 // Overridden from ViewManagerTransaction: | 236 // Overridden from ViewManagerTransaction: |
| 237 virtual void DoCommit() OVERRIDE { | 237 virtual void DoCommit() OVERRIDE { |
| 238 GetAndAdvanceNextServerChangeId(); | 238 service()->DeleteNode(node_id_, |
| 239 service()->DeleteNode(node_id_, ActionCompletedCallback()); | 239 GetAndAdvanceNextServerChangeId(), |
| 240 ActionCompletedCallback()); |
| 240 } | 241 } |
| 241 virtual void DoActionCompleted(bool success) OVERRIDE { | 242 virtual void DoActionCompleted(bool success) OVERRIDE { |
| 242 // TODO(beng): recovery? | 243 // TODO(beng): recovery? |
| 243 } | 244 } |
| 244 | 245 |
| 245 const Id node_id_; | 246 const Id node_id_; |
| 246 DISALLOW_COPY_AND_ASSIGN(DestroyViewTreeNodeTransaction); | 247 DISALLOW_COPY_AND_ASSIGN(DestroyViewTreeNodeTransaction); |
| 247 }; | 248 }; |
| 248 | 249 |
| 249 class AddChildTransaction : public ViewManagerTransaction { | 250 class AddChildTransaction : public ViewManagerTransaction { |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 // ViewManager, public: | 831 // ViewManager, public: |
| 831 | 832 |
| 832 // static | 833 // static |
| 833 void ViewManager::Create(Application* application, | 834 void ViewManager::Create(Application* application, |
| 834 ViewManagerDelegate* delegate) { | 835 ViewManagerDelegate* delegate) { |
| 835 application->AddService<ViewManagerSynchronizer>(delegate); | 836 application->AddService<ViewManagerSynchronizer>(delegate); |
| 836 } | 837 } |
| 837 | 838 |
| 838 } // namespace view_manager | 839 } // namespace view_manager |
| 839 } // namespace mojo | 840 } // namespace mojo |
| OLD | NEW |