Index: components/view_manager/view_manager_app.cc |
diff --git a/components/view_manager/view_manager_app.cc b/components/view_manager/view_manager_app.cc |
index 0dac932b22b65e158e8bd410d3756f22cd6776af..75ffcde6a4a9e92ce3db3376ca8469046877a77c 100644 |
--- a/components/view_manager/view_manager_app.cc |
+++ b/components/view_manager/view_manager_app.cc |
@@ -8,6 +8,7 @@ |
#include "components/view_manager/client_connection.h" |
#include "components/view_manager/connection_manager.h" |
#include "components/view_manager/display_manager.h" |
+#include "components/view_manager/native_viewport/native_viewport_impl.h" |
#include "components/view_manager/public/cpp/args.h" |
#include "components/view_manager/view_manager_service_impl.h" |
#include "mojo/application/public/cpp/application_connection.h" |
@@ -23,6 +24,7 @@ |
using mojo::ApplicationImpl; |
using mojo::Gpu; |
using mojo::InterfaceRequest; |
+using mojo::NativeViewport; |
using mojo::ViewManagerRoot; |
using mojo::ViewManagerService; |
@@ -37,6 +39,12 @@ |
app_impl_ = app; |
tracing_.Initialize(app); |
+ scoped_ptr<DefaultDisplayManager> display_manager(new DefaultDisplayManager( |
+ app_impl_, base::Bind(&ViewManagerApp::OnLostConnectionToWindowManager, |
+ base::Unretained(this)))); |
+ connection_manager_.reset( |
+ new ConnectionManager(this, display_manager.Pass())); |
+ |
#if !defined(OS_ANDROID) |
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
is_headless_ = command_line->HasSwitch(mojo::kUseHeadlessConfig); |
@@ -48,17 +56,6 @@ |
gfx::GLSurface::InitializeOneOff(); |
} |
#endif |
- |
- if (!gpu_state_.get()) |
- gpu_state_ = new gles2::GpuState; |
- scoped_ptr<DefaultDisplayManager> display_manager(new DefaultDisplayManager( |
- is_headless_, |
- app_impl_, |
- gpu_state_, |
- base::Bind(&ViewManagerApp::OnLostConnectionToWindowManager, |
- base::Unretained(this)))); |
- connection_manager_.reset( |
- new ConnectionManager(this, display_manager.Pass())); |
} |
bool ViewManagerApp::ConfigureIncomingConnection( |
@@ -68,6 +65,7 @@ |
// to the ViewManager. |
connection->AddService<ViewManagerService>(this); |
connection->AddService<ViewManagerRoot>(this); |
+ connection->AddService<NativeViewport>(this); |
connection->AddService<Gpu>(this); |
return true; |
@@ -143,6 +141,18 @@ |
void ViewManagerApp::Create( |
mojo::ApplicationConnection* connection, |
+ mojo::InterfaceRequest<NativeViewport> request) { |
+ if (!gpu_state_.get()) |
+ gpu_state_ = new gles2::GpuState; |
+ new native_viewport::NativeViewportImpl( |
+ is_headless_, |
+ gpu_state_, |
+ request.Pass(), |
+ app_impl_->app_lifetime_helper()->CreateAppRefCount()); |
+} |
+ |
+void ViewManagerApp::Create( |
+ mojo::ApplicationConnection* connection, |
mojo::InterfaceRequest<Gpu> request) { |
if (!gpu_state_.get()) |
gpu_state_ = new gles2::GpuState; |