OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "shell/android/native_viewport_application_loader.h" |
| 6 |
| 7 #include "mojo/public/cpp/application/application_impl.h" |
| 8 #include "services/native_viewport/native_viewport_impl.h" |
| 9 |
| 10 namespace mojo { |
| 11 namespace shell { |
| 12 |
| 13 NativeViewportApplicationLoader::NativeViewportApplicationLoader() |
| 14 : gpu_state_(new gles2::GpuImpl::State) { |
| 15 } |
| 16 |
| 17 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() { |
| 18 } |
| 19 |
| 20 void NativeViewportApplicationLoader::Load(ApplicationManager* manager, |
| 21 const GURL& url, |
| 22 ScopedMessagePipeHandle shell_handle, |
| 23 LoadCallback callback) { |
| 24 DCHECK(shell_handle.is_valid()); |
| 25 app_.reset(new ApplicationImpl(this, shell_handle.Pass())); |
| 26 } |
| 27 |
| 28 void NativeViewportApplicationLoader::OnApplicationError( |
| 29 ApplicationManager* manager, |
| 30 const GURL& url) { |
| 31 } |
| 32 |
| 33 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( |
| 34 mojo::ApplicationConnection* connection) { |
| 35 connection->AddService<NativeViewport>(this); |
| 36 connection->AddService<Gpu>(this); |
| 37 return true; |
| 38 } |
| 39 |
| 40 void NativeViewportApplicationLoader::Create( |
| 41 ApplicationConnection* connection, |
| 42 InterfaceRequest<NativeViewport> request) { |
| 43 BindToRequest(new native_viewport::NativeViewportImpl(app_.get(), false), |
| 44 &request); |
| 45 } |
| 46 |
| 47 void NativeViewportApplicationLoader::Create( |
| 48 ApplicationConnection* connection, |
| 49 InterfaceRequest<Gpu> request) { |
| 50 new gles2::GpuImpl(request.Pass(), gpu_state_); |
| 51 } |
| 52 |
| 53 } // namespace shell |
| 54 } // namespace mojo |
OLD | NEW |