Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: shell/android/native_viewport_application_loader.cc

Issue 856063002: Adding keyboard service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix local variable Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « shell/android/native_viewport_application_loader.h ('k') | sky/engine/core/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "shell/android/native_viewport_application_loader.h" 5 #include "shell/android/native_viewport_application_loader.h"
6 6
7 #include "mojo/public/cpp/application/application_impl.h" 7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "services/native_viewport/native_viewport_impl.h" 8 #include "services/native_viewport/native_viewport_impl.h"
9 #include "shell/android/keyboard_impl.h"
9 10
10 namespace mojo { 11 namespace mojo {
11 namespace shell { 12 namespace shell {
12 13
13 NativeViewportApplicationLoader::NativeViewportApplicationLoader() { 14 NativeViewportApplicationLoader::NativeViewportApplicationLoader() {
14 } 15 }
15 16
16 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() { 17 NativeViewportApplicationLoader::~NativeViewportApplicationLoader() {
17 } 18 }
18 19
19 void NativeViewportApplicationLoader::Load(ApplicationManager* manager, 20 void NativeViewportApplicationLoader::Load(ApplicationManager* manager,
20 const GURL& url, 21 const GURL& url,
21 ScopedMessagePipeHandle shell_handle, 22 ScopedMessagePipeHandle shell_handle,
22 LoadCallback callback) { 23 LoadCallback callback) {
23 DCHECK(shell_handle.is_valid()); 24 DCHECK(shell_handle.is_valid());
24 app_.reset(new ApplicationImpl(this, shell_handle.Pass())); 25 app_.reset(new ApplicationImpl(this, shell_handle.Pass()));
25 } 26 }
26 27
27 void NativeViewportApplicationLoader::OnApplicationError( 28 void NativeViewportApplicationLoader::OnApplicationError(
28 ApplicationManager* manager, 29 ApplicationManager* manager,
29 const GURL& url) { 30 const GURL& url) {
30 } 31 }
31 32
32 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( 33 bool NativeViewportApplicationLoader::ConfigureIncomingConnection(
33 mojo::ApplicationConnection* connection) { 34 mojo::ApplicationConnection* connection) {
34 connection->AddService<NativeViewport>(this); 35 connection->AddService<NativeViewport>(this);
35 connection->AddService<Gpu>(this); 36 connection->AddService<Gpu>(this);
37 connection->AddService<Keyboard>(this);
36 return true; 38 return true;
37 } 39 }
38 40
39 void NativeViewportApplicationLoader::Create( 41 void NativeViewportApplicationLoader::Create(
40 ApplicationConnection* connection, 42 ApplicationConnection* connection,
41 InterfaceRequest<NativeViewport> request) { 43 InterfaceRequest<NativeViewport> request) {
42 BindToRequest(new native_viewport::NativeViewportImpl(app_.get(), false), 44 BindToRequest(new native_viewport::NativeViewportImpl(app_.get(), false),
43 &request); 45 &request);
44 } 46 }
45 47
46 void NativeViewportApplicationLoader::Create( 48 void NativeViewportApplicationLoader::Create(
47 ApplicationConnection* connection, 49 ApplicationConnection* connection,
48 InterfaceRequest<Gpu> request) { 50 InterfaceRequest<Keyboard> request) {
51 new KeyboardImpl(request.Pass());
52 }
53
54 void NativeViewportApplicationLoader::Create(ApplicationConnection* connection,
55 InterfaceRequest<Gpu> request) {
49 if (!gpu_state_) 56 if (!gpu_state_)
50 gpu_state_ = new gles2::GpuImpl::State; 57 gpu_state_ = new gles2::GpuImpl::State;
51 new gles2::GpuImpl(request.Pass(), gpu_state_); 58 new gles2::GpuImpl(request.Pass(), gpu_state_);
52 } 59 }
53 60
54 } // namespace shell 61 } // namespace shell
55 } // namespace mojo 62 } // namespace mojo
OLDNEW
« no previous file with comments | « shell/android/native_viewport_application_loader.h ('k') | sky/engine/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698