| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 DISALLOW_COPY_AND_ASSIGN(Navigator); | 65 DISALLOW_COPY_AND_ASSIGN(Navigator); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // Overridden from ApplicationImpl: | 68 // Overridden from ApplicationImpl: |
| 69 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 69 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
| 70 MOJO_OVERRIDE { | 70 MOJO_OVERRIDE { |
| 71 ViewManager::ConfigureIncomingConnection(connection, this); | 71 ViewManager::ConfigureIncomingConnection(connection, this); |
| 72 connection->ConnectToService(&window_manager_); | 72 connection->ConnectToService(&window_manager_); |
| 73 connection->AddService<Navigator>(this); | 73 connection->AddService<Navigator>(this); |
| 74 // TODO(davemoore): Is this ok? | 74 // TODO(davemoore): Is this ok? |
| 75 if (!navigator_.get()) { | 75 if (!navigator_) { |
| 76 connection->ConnectToApplication( | 76 connection->ConnectToApplication( |
| 77 kEmbeddedAppURL)->ConnectToService(&navigator_); | 77 kEmbeddedAppURL)->ConnectToService(&navigator_); |
| 78 } | 78 } |
| 79 return true; | 79 return true; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Overridden from ViewManagerDelegate: | 82 // Overridden from ViewManagerDelegate: |
| 83 virtual void OnRootAdded(ViewManager* view_manager, Node* root) OVERRIDE { | 83 virtual void OnRootAdded(ViewManager* view_manager, Node* root) OVERRIDE { |
| 84 root->AddObserver(this); | 84 root->AddObserver(this); |
| 85 | 85 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace examples | 136 } // namespace examples |
| 137 | 137 |
| 138 // static | 138 // static |
| 139 ApplicationDelegate* ApplicationDelegate::Create() { | 139 ApplicationDelegate* ApplicationDelegate::Create() { |
| 140 return new examples::NestingApp; | 140 return new examples::NestingApp; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace mojo | 143 } // namespace mojo |
| OLD | NEW |