| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 73 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
| 74 MOJO_OVERRIDE { | 74 MOJO_OVERRIDE { |
| 75 connection->AddService(&view_manager_client_factory_); | 75 connection->AddService(&view_manager_client_factory_); |
| 76 connection->AddService(&navigator_factory_); | 76 connection->AddService(&navigator_factory_); |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 // Overridden from ViewManagerDelegate: | 80 // Overridden from ViewManagerDelegate: |
| 81 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { | 81 virtual void OnEmbed(ViewManager* view_manager, |
| 82 Node* root, |
| 83 ExportedServiceRegistry* exported_services, |
| 84 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { |
| 82 View* view = View::Create(view_manager); | 85 View* view = View::Create(view_manager); |
| 83 view->AddObserver(this); | 86 view->AddObserver(this); |
| 84 root->SetActiveView(view); | 87 root->SetActiveView(view); |
| 85 root->AddObserver(this); | 88 root->AddObserver(this); |
| 86 | 89 |
| 87 roots_[root->id()] = root; | 90 roots_[root->id()] = root; |
| 88 ProcessPendingNodeColor(root->id()); | 91 ProcessPendingNodeColor(root->id()); |
| 89 } | 92 } |
| 90 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { | 93 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { |
| 91 base::MessageLoop::current()->Quit(); | 94 base::MessageLoop::current()->Quit(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 171 } |
| 169 | 172 |
| 170 } // namespace examples | 173 } // namespace examples |
| 171 | 174 |
| 172 // static | 175 // static |
| 173 ApplicationDelegate* ApplicationDelegate::Create() { | 176 ApplicationDelegate* ApplicationDelegate::Create() { |
| 174 return new examples::EmbeddedApp; | 177 return new examples::EmbeddedApp; |
| 175 } | 178 } |
| 176 | 179 |
| 177 } // namespace mojo | 180 } // namespace mojo |
| OLD | NEW |