| 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 "components/view_manager/view_manager_app.h" | 5 #include "components/view_manager/view_manager_app.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "components/view_manager/client_connection.h" | 9 #include "components/view_manager/client_connection.h" |
| 10 #include "components/view_manager/connection_manager.h" | 10 #include "components/view_manager/connection_manager.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 event_source_ = ui::PlatformEventSource::CreateDefault(); | 59 event_source_ = ui::PlatformEventSource::CreateDefault(); |
| 60 if (command_line->HasSwitch(mojo::kUseTestConfig)) | 60 if (command_line->HasSwitch(mojo::kUseTestConfig)) |
| 61 gfx::GLSurfaceTestSupport::InitializeOneOff(); | 61 gfx::GLSurfaceTestSupport::InitializeOneOff(); |
| 62 else | 62 else |
| 63 gfx::GLSurface::InitializeOneOff(); | 63 gfx::GLSurface::InitializeOneOff(); |
| 64 } | 64 } |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 if (!gpu_state_.get()) | 67 if (!gpu_state_.get()) |
| 68 gpu_state_ = new gles2::GpuState; | 68 gpu_state_ = new gles2::GpuState; |
| 69 connection_manager_.reset(new ConnectionManager(this)); | 69 connection_manager_.reset(new ConnectionManager(this, surfaces_state_)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool ViewManagerApp::ConfigureIncomingConnection( | 72 bool ViewManagerApp::ConfigureIncomingConnection( |
| 73 ApplicationConnection* connection) { | 73 ApplicationConnection* connection) { |
| 74 // ViewManager | 74 // ViewManager |
| 75 connection->AddService<ViewManagerRoot>(this); | 75 connection->AddService<ViewManagerRoot>(this); |
| 76 // Surfaces | 76 // Surfaces |
| 77 // TODO(fsamuel): This should go away soon. | 77 // TODO(fsamuel): This should go away soon. |
| 78 connection->AddService<mojo::Surface>(this); | 78 connection->AddService<mojo::Surface>(this); |
| 79 // GPU | 79 // GPU |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 surfaces_.insert( | 145 surfaces_.insert( |
| 146 new surfaces::SurfacesImpl(this, surfaces_state_, request.Pass())); | 146 new surfaces::SurfacesImpl(this, surfaces_state_, request.Pass())); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ViewManagerApp::OnSurfaceConnectionClosed( | 149 void ViewManagerApp::OnSurfaceConnectionClosed( |
| 150 surfaces::SurfacesImpl* surface) { | 150 surfaces::SurfacesImpl* surface) { |
| 151 surfaces_.erase(surface); | 151 surfaces_.erase(surface); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace view_manager | 154 } // namespace view_manager |
| OLD | NEW |