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.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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 const Callback<void()>& ack_callback) { | 768 const Callback<void()>& ack_callback) { |
769 View* view = GetViewById(view_id); | 769 View* view = GetViewById(view_id); |
770 if (view) { | 770 if (view) { |
771 FOR_EACH_OBSERVER(ViewObserver, | 771 FOR_EACH_OBSERVER(ViewObserver, |
772 *ViewPrivate(view).observers(), | 772 *ViewPrivate(view).observers(), |
773 OnViewInputEvent(view, event)); | 773 OnViewInputEvent(view, event)); |
774 } | 774 } |
775 ack_callback.Run(); | 775 ack_callback.Run(); |
776 } | 776 } |
777 | 777 |
| 778 void ViewManagerClientImpl::DispatchOnViewInputEvent(Id view_id, |
| 779 EventPtr event) { |
| 780 // For now blindly bounce the message back to the server. Doing this means the |
| 781 // event is sent to the correct target (|view_id|). |
| 782 // Note: This function is only invoked on the window manager. |
| 783 service_->DispatchOnViewInputEvent(view_id, event.Pass()); |
| 784 } |
| 785 |
778 //////////////////////////////////////////////////////////////////////////////// | 786 //////////////////////////////////////////////////////////////////////////////// |
779 // ViewManagerClientImpl, private: | 787 // ViewManagerClientImpl, private: |
780 | 788 |
781 void ViewManagerClientImpl::Sync() { | 789 void ViewManagerClientImpl::Sync() { |
782 // The service connection may not be set up yet. OnConnectionEstablished() | 790 // The service connection may not be set up yet. OnConnectionEstablished() |
783 // will schedule another sync when it is. | 791 // will schedule another sync when it is. |
784 if (!connected_) | 792 if (!connected_) |
785 return; | 793 return; |
786 | 794 |
787 Transactions::const_iterator it = pending_transactions_.begin(); | 795 Transactions::const_iterator it = pending_transactions_.begin(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 // ViewManager, public: | 833 // ViewManager, public: |
826 | 834 |
827 // static | 835 // static |
828 void ViewManager::Create(Application* application, | 836 void ViewManager::Create(Application* application, |
829 ViewManagerDelegate* delegate) { | 837 ViewManagerDelegate* delegate) { |
830 application->AddService<ViewManagerClientImpl>(delegate); | 838 application->AddService<ViewManagerClientImpl>(delegate); |
831 } | 839 } |
832 | 840 |
833 } // namespace view_manager | 841 } // namespace view_manager |
834 } // namespace mojo | 842 } // namespace mojo |
OLD | NEW |