| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "mojo/application/application_runner_chromium.h" | 6 #include "mojo/application/application_runner_chromium.h" |
| 7 #include "mojo/public/c/system/main.h" | 7 #include "mojo/public/c/system/main.h" |
| 8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/service_provider_impl.h" | 9 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 10 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 10 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 view_manager_ = view_manager; | 46 view_manager_ = view_manager; |
| 47 root_ = root; | 47 root_ = root; |
| 48 } | 48 } |
| 49 void OnViewManagerDisconnected(ViewManager* view_manager) override {} | 49 void OnViewManagerDisconnected(ViewManager* view_manager) override {} |
| 50 | 50 |
| 51 // Overridden from WindowManagerDelegate: | 51 // Overridden from WindowManagerDelegate: |
| 52 void Embed(const String& url, | 52 void Embed(const String& url, |
| 53 InterfaceRequest<ServiceProvider> service_provider) override { | 53 InterfaceRequest<ServiceProvider> service_provider) override { |
| 54 View* view = View::Create(view_manager_); | 54 View* view = View::Create(view_manager_); |
| 55 root_->AddChild(view); | 55 root_->AddChild(view); |
| 56 view->SetVisible(true); |
| 56 view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>( | 57 view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>( |
| 57 new mojo::ServiceProviderImpl).Pass()); | 58 new mojo::ServiceProviderImpl).Pass()); |
| 58 } | 59 } |
| 59 | 60 |
| 60 scoped_ptr<WindowManagerApp> window_manager_app_; | 61 scoped_ptr<WindowManagerApp> window_manager_app_; |
| 61 | 62 |
| 62 ViewManager* view_manager_; | 63 ViewManager* view_manager_; |
| 63 View* root_; | 64 View* root_; |
| 64 | 65 |
| 65 MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager); | 66 MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace mojo | 69 } // namespace mojo |
| 69 | 70 |
| 70 MojoResult MojoMain(MojoHandle shell_handle) { | 71 MojoResult MojoMain(MojoHandle shell_handle) { |
| 71 mojo::ApplicationRunnerChromium runner(new mojo::DefaultWindowManager); | 72 mojo::ApplicationRunnerChromium runner(new mojo::DefaultWindowManager); |
| 72 return runner.Run(shell_handle); | 73 return runner.Run(shell_handle); |
| 73 } | 74 } |
| OLD | NEW |