Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.cc

Issue 311423003: Provide an API to the example window manager app that supports closing a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 public: 227 public:
228 DestroyViewTreeNodeTransaction(TransportNodeId node_id, 228 DestroyViewTreeNodeTransaction(TransportNodeId node_id,
229 ViewManagerSynchronizer* synchronizer) 229 ViewManagerSynchronizer* synchronizer)
230 : ViewManagerTransaction(TYPE_DESTROY_VIEW_TREE_NODE, synchronizer), 230 : ViewManagerTransaction(TYPE_DESTROY_VIEW_TREE_NODE, synchronizer),
231 node_id_(node_id) {} 231 node_id_(node_id) {}
232 virtual ~DestroyViewTreeNodeTransaction() {} 232 virtual ~DestroyViewTreeNodeTransaction() {}
233 233
234 private: 234 private:
235 // Overridden from ViewManagerTransaction: 235 // Overridden from ViewManagerTransaction:
236 virtual void DoCommit() OVERRIDE { 236 virtual void DoCommit() OVERRIDE {
237 GetAndAdvanceNextServerChangeId();
237 service()->DeleteNode(node_id_, ActionCompletedCallback()); 238 service()->DeleteNode(node_id_, ActionCompletedCallback());
238 } 239 }
239 virtual void DoActionCompleted(bool success) OVERRIDE { 240 virtual void DoActionCompleted(bool success) OVERRIDE {
240 // TODO(beng): recovery? 241 // TODO(beng): recovery?
241 } 242 }
242 243
243 const TransportNodeId node_id_; 244 const TransportNodeId node_id_;
244 DISALLOW_COPY_AND_ASSIGN(DestroyViewTreeNodeTransaction); 245 DISALLOW_COPY_AND_ASSIGN(DestroyViewTreeNodeTransaction);
245 }; 246 };
246 247
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 void ViewManagerSynchronizer::RemoveFromPendingQueue( 672 void ViewManagerSynchronizer::RemoveFromPendingQueue(
672 ViewManagerTransaction* transaction) { 673 ViewManagerTransaction* transaction) {
673 DCHECK_EQ(transaction, pending_transactions_.front()); 674 DCHECK_EQ(transaction, pending_transactions_.front());
674 pending_transactions_.erase(pending_transactions_.begin()); 675 pending_transactions_.erase(pending_transactions_.begin());
675 if (pending_transactions_.empty() && !changes_acked_callback_.is_null()) 676 if (pending_transactions_.empty() && !changes_acked_callback_.is_null())
676 changes_acked_callback_.Run(); 677 changes_acked_callback_.Run();
677 } 678 }
678 679
679 } // namespace view_manager 680 } // namespace view_manager
680 } // namespace mojo 681 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698