| 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/view_manager/public/cpp/view_manager.h" | 5 #include "mojo/services/view_manager/public/cpp/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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 private: | 56 private: |
| 57 // Overridden from ApplicationDelegate: | 57 // Overridden from ApplicationDelegate: |
| 58 void Initialize(ApplicationImpl* app) override { | 58 void Initialize(ApplicationImpl* app) override { |
| 59 view_manager_client_factory_.reset( | 59 view_manager_client_factory_.reset( |
| 60 new ViewManagerClientFactory(app->shell(), this)); | 60 new ViewManagerClientFactory(app->shell(), this)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Overridden from ApplicationLoader: | 63 // Overridden from ApplicationLoader: |
| 64 void Load(ApplicationManager* manager, | 64 void Load(ApplicationManager* manager, |
| 65 const GURL& url, | 65 const GURL& url, |
| 66 ScopedMessagePipeHandle shell_handle, | 66 InterfaceRequest<Application> application_request, |
| 67 LoadCallback callback) override { | 67 LoadCallback callback) override { |
| 68 ASSERT_TRUE(shell_handle.is_valid()); | 68 ASSERT_TRUE(application_request.is_pending()); |
| 69 scoped_ptr<ApplicationImpl> app( | 69 scoped_ptr<ApplicationImpl> app( |
| 70 new ApplicationImpl(this, shell_handle.Pass())); | 70 new ApplicationImpl(this, application_request.Pass())); |
| 71 apps_.push_back(app.release()); | 71 apps_.push_back(app.release()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void OnApplicationError(ApplicationManager* manager, | 74 void OnApplicationError(ApplicationManager* manager, |
| 75 const GURL& url) override {} | 75 const GURL& url) override {} |
| 76 | 76 |
| 77 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { | 77 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { |
| 78 connection->AddService(view_manager_client_factory_.get()); | 78 connection->AddService(view_manager_client_factory_.get()); |
| 79 return true; | 79 return true; |
| 80 } | 80 } |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 643 |
| 644 // TODO(beng): tests for focus: | 644 // TODO(beng): tests for focus: |
| 645 // - focus between two views known to a connection | 645 // - focus between two views known to a connection |
| 646 // - focus between views unknown to one of the connections. | 646 // - focus between views unknown to one of the connections. |
| 647 // - focus between views unknown to either connection. | 647 // - focus between views unknown to either connection. |
| 648 | 648 |
| 649 // TODO(sky): need test of root being destroyed with existing views. See | 649 // TODO(sky): need test of root being destroyed with existing views. See |
| 650 // 434555 for specific case. | 650 // 434555 for specific case. |
| 651 | 651 |
| 652 } // namespace mojo | 652 } // namespace mojo |
| OLD | NEW |