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/view_manager.h" | 5 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 public ViewManagerDelegate { | 46 public ViewManagerDelegate { |
47 public: | 47 public: |
48 typedef base::Callback<void(ViewManager*, Node*)> LoadedCallback; | 48 typedef base::Callback<void(ViewManager*, Node*)> LoadedCallback; |
49 | 49 |
50 explicit ConnectServiceLoader(const LoadedCallback& callback) | 50 explicit ConnectServiceLoader(const LoadedCallback& callback) |
51 : callback_(callback), view_manager_client_factory_(this) {} | 51 : callback_(callback), view_manager_client_factory_(this) {} |
52 virtual ~ConnectServiceLoader() {} | 52 virtual ~ConnectServiceLoader() {} |
53 | 53 |
54 private: | 54 private: |
55 // Overridden from ServiceLoader: | 55 // Overridden from ServiceLoader: |
56 virtual void LoadService(ServiceManager* manager, | 56 virtual void Load(ServiceManager* manager, |
57 const GURL& url, | 57 const GURL& url, |
58 ScopedMessagePipeHandle shell_handle) OVERRIDE { | 58 scoped_refptr<LoadCallbacks> callbacks) OVERRIDE { |
| 59 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); |
| 60 if (!shell_handle.is_valid()) |
| 61 return; |
59 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, | 62 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, |
60 shell_handle.Pass())); | 63 shell_handle.Pass())); |
61 apps_.push_back(app.release()); | 64 apps_.push_back(app.release()); |
62 } | 65 } |
63 | 66 |
64 virtual void OnServiceError(ServiceManager* manager, | 67 virtual void OnServiceError(ServiceManager* manager, |
65 const GURL& url) OVERRIDE { | 68 const GURL& url) OVERRIDE { |
66 } | 69 } |
67 | 70 |
68 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 71 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 671 |
669 // TODO(beng): tests for view event dispatcher. | 672 // TODO(beng): tests for view event dispatcher. |
670 // - verify that we see events for all views. | 673 // - verify that we see events for all views. |
671 | 674 |
672 // TODO(beng): tests for focus: | 675 // TODO(beng): tests for focus: |
673 // - focus between two nodes known to a connection | 676 // - focus between two nodes known to a connection |
674 // - focus between nodes unknown to one of the connections. | 677 // - focus between nodes unknown to one of the connections. |
675 // - focus between nodes unknown to either connection. | 678 // - focus between nodes unknown to either connection. |
676 | 679 |
677 } // namespace mojo | 680 } // namespace mojo |
OLD | NEW |