| 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/application_manager/application_manager.h" | 10 #include "mojo/application_manager/application_manager.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 scoped_refptr<LoadCallbacks> callbacks) override { | 67 scoped_refptr<LoadCallbacks> callbacks) override { |
| 67 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | 68 ASSERT_TRUE(shell_handle.is_valid()); |
| 68 if (!shell_handle.is_valid()) | 69 scoped_ptr<ApplicationImpl> app( |
| 69 return; | 70 new ApplicationImpl(this, shell_handle.Pass())); |
| 70 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, | |
| 71 shell_handle.Pass())); | |
| 72 apps_.push_back(app.release()); | 71 apps_.push_back(app.release()); |
| 73 } | 72 } |
| 74 | 73 |
| 75 void OnApplicationError(ApplicationManager* manager, | 74 void OnApplicationError(ApplicationManager* manager, |
| 76 const GURL& url) override {} | 75 const GURL& url) override {} |
| 77 | 76 |
| 78 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { | 77 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { |
| 79 connection->AddService(view_manager_client_factory_.get()); | 78 connection->AddService(view_manager_client_factory_.get()); |
| 80 return true; | 79 return true; |
| 81 } | 80 } |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 625 |
| 627 // TODO(beng): tests for view event dispatcher. | 626 // TODO(beng): tests for view event dispatcher. |
| 628 // - verify that we see events for all views. | 627 // - verify that we see events for all views. |
| 629 | 628 |
| 630 // TODO(beng): tests for focus: | 629 // TODO(beng): tests for focus: |
| 631 // - focus between two views known to a connection | 630 // - focus between two views known to a connection |
| 632 // - focus between views unknown to one of the connections. | 631 // - focus between views unknown to one of the connections. |
| 633 // - focus between views unknown to either connection. | 632 // - focus between views unknown to either connection. |
| 634 | 633 |
| 635 } // namespace mojo | 634 } // namespace mojo |
| OLD | NEW |