| 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_context.h" | 5 #include "mojo/services/public/cpp/view_manager/view_manager_context.h" |
| 6 | 6 |
| 7 #include "mojo/public/cpp/application/application_impl.h" | 7 #include "mojo/public/cpp/application/application_impl.h" |
| 8 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 8 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 class ApplicationImpl; | 11 class ApplicationImpl; |
| 12 | 12 |
| 13 void ConnectCallback(bool success) {} | 13 void ConnectCallback(bool success) {} |
| 14 | 14 |
| 15 class ViewManagerContext::InternalState { | 15 class ViewManagerContext::InternalState { |
| 16 public: | 16 public: |
| 17 InternalState(ApplicationImpl* application_impl) { | 17 InternalState(ApplicationImpl* application_impl) { |
| 18 application_impl->ConnectToService("mojo:mojo_view_manager", | 18 application_impl->ConnectToService("mojo:view_manager", &init_service_); |
| 19 &init_service_); | |
| 20 } | 19 } |
| 21 ~InternalState() {} | 20 ~InternalState() {} |
| 22 | 21 |
| 23 ViewManagerInitService* init_service() { return init_service_.get(); } | 22 ViewManagerInitService* init_service() { return init_service_.get(); } |
| 24 | 23 |
| 25 private: | 24 private: |
| 26 ViewManagerInitServicePtr init_service_; | 25 ViewManagerInitServicePtr init_service_; |
| 27 | 26 |
| 28 MOJO_DISALLOW_COPY_AND_ASSIGN(InternalState); | 27 MOJO_DISALLOW_COPY_AND_ASSIGN(InternalState); |
| 29 }; | 28 }; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 46 ServiceProviderPtr sp; | 45 ServiceProviderPtr sp; |
| 47 if (registry) { | 46 if (registry) { |
| 48 BindToProxy(registry, &sp); | 47 BindToProxy(registry, &sp); |
| 49 imported_services.reset(registry->CreateRemoteServiceProvider()); | 48 imported_services.reset(registry->CreateRemoteServiceProvider()); |
| 50 } | 49 } |
| 51 state_->init_service()->Embed(url, sp.Pass(), base::Bind(&ConnectCallback)); | 50 state_->init_service()->Embed(url, sp.Pass(), base::Bind(&ConnectCallback)); |
| 52 return imported_services.Pass(); | 51 return imported_services.Pass(); |
| 53 } | 52 } |
| 54 | 53 |
| 55 } // namespace mojo | 54 } // namespace mojo |
| OLD | NEW |