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 "view_manager/public/cpp/view_manager_context.h" | 5 #include "view_manager/public/cpp/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/public/cpp/bindings/interface_request.h" | 8 #include "mojo/public/cpp/bindings/interface_request.h" |
9 #include "window_manager/public/interfaces/window_manager.mojom.h" | 9 #include "window_manager/public/interfaces/window_manager.mojom.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 WindowManager* wm() { return wm_.get(); } | 21 WindowManager* wm() { return wm_.get(); } |
22 | 22 |
23 private: | 23 private: |
24 WindowManagerPtr wm_; | 24 WindowManagerPtr wm_; |
25 | 25 |
26 MOJO_DISALLOW_COPY_AND_ASSIGN(InternalState); | 26 MOJO_DISALLOW_COPY_AND_ASSIGN(InternalState); |
27 }; | 27 }; |
28 | 28 |
29 ViewManagerContext::ViewManagerContext(ApplicationImpl* application_impl) | 29 ViewManagerContext::ViewManagerContext(ApplicationImpl* application_impl) |
30 : state_(new InternalState(application_impl)) {} | 30 : state_(new InternalState(application_impl)) {} |
31 ViewManagerContext::~ViewManagerContext() {} | 31 ViewManagerContext::~ViewManagerContext() { |
| 32 delete state_; |
| 33 } |
32 | 34 |
33 void ViewManagerContext::Embed(const String& url) { | 35 void ViewManagerContext::Embed(const String& url) { |
34 Embed(url, nullptr, nullptr); | 36 Embed(url, nullptr, nullptr); |
35 } | 37 } |
36 | 38 |
37 void ViewManagerContext::Embed(const String& url, | 39 void ViewManagerContext::Embed(const String& url, |
38 InterfaceRequest<ServiceProvider> services, | 40 InterfaceRequest<ServiceProvider> services, |
39 ServiceProviderPtr exposed_services) { | 41 ServiceProviderPtr exposed_services) { |
40 state_->wm()->Embed(url, services.Pass(), exposed_services.Pass()); | 42 state_->wm()->Embed(url, services.Pass(), exposed_services.Pass()); |
41 } | 43 } |
42 | 44 |
43 } // namespace mojo | 45 } // namespace mojo |
OLD | NEW |