| 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/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "mojo/examples/window_manager/window_manager.mojom.h" | 9 #include "mojo/examples/window_manager/window_manager.mojom.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 connection->AddService(&navigator_factory_); | 80 connection->AddService(&navigator_factory_); |
| 81 // TODO(davemoore): Is this ok? | 81 // TODO(davemoore): Is this ok? |
| 82 if (!navigator_) { | 82 if (!navigator_) { |
| 83 connection->ConnectToApplication( | 83 connection->ConnectToApplication( |
| 84 kEmbeddedAppURL)->ConnectToService(&navigator_); | 84 kEmbeddedAppURL)->ConnectToService(&navigator_); |
| 85 } | 85 } |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Overridden from ViewManagerDelegate: | 89 // Overridden from ViewManagerDelegate: |
| 90 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { | 90 virtual void OnEmbed(ViewManager* view_manager, |
| 91 Node* root, |
| 92 ExportedServiceRegistry* exported_services, |
| 93 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { |
| 91 root->AddObserver(this); | 94 root->AddObserver(this); |
| 92 | 95 |
| 93 View* view = View::Create(view_manager); | 96 View* view = View::Create(view_manager); |
| 94 root->SetActiveView(view); | 97 root->SetActiveView(view); |
| 95 view->SetColor(SK_ColorCYAN); | 98 view->SetColor(SK_ColorCYAN); |
| 96 view->AddObserver(this); | 99 view->AddObserver(this); |
| 97 | 100 |
| 98 nested_ = Node::Create(view_manager); | 101 nested_ = Node::Create(view_manager); |
| 99 root->AddChild(nested_); | 102 root->AddChild(nested_); |
| 100 nested_->SetBounds(gfx::Rect(20, 20, 50, 50)); | 103 nested_->SetBounds(gfx::Rect(20, 20, 50, 50)); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 145 } |
| 143 | 146 |
| 144 } // namespace examples | 147 } // namespace examples |
| 145 | 148 |
| 146 // static | 149 // static |
| 147 ApplicationDelegate* ApplicationDelegate::Create() { | 150 ApplicationDelegate* ApplicationDelegate::Create() { |
| 148 return new examples::NestingApp; | 151 return new examples::NestingApp; |
| 149 } | 152 } |
| 150 | 153 |
| 151 } // namespace mojo | 154 } // namespace mojo |
| OLD | NEW |