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

Unified Diff: mojo/shell/android/native_viewport_application_loader.cc

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: mojo/shell/android/native_viewport_application_loader.cc
diff --git a/mojo/shell/android/native_viewport_application_loader.cc b/mojo/shell/android/native_viewport_application_loader.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e3e3767b4f14bfd78c71303c36ecb60674bc9dbf
--- /dev/null
+++ b/mojo/shell/android/native_viewport_application_loader.cc
@@ -0,0 +1,58 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/shell/android/native_viewport_application_loader.h"
+
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/services/gles2/gpu_state.h"
+#include "mojo/services/native_viewport/native_viewport_impl.h"
+#include "mojo/shell/android/keyboard_impl.h"
+
+namespace mojo {
+namespace shell {
+
+NativeViewportApplicationLoader::NativeViewportApplicationLoader() {
+}
+
+NativeViewportApplicationLoader::~NativeViewportApplicationLoader() {
+}
+
+void NativeViewportApplicationLoader::Load(
+ const GURL& url,
+ InterfaceRequest<Application> application_request) {
+ DCHECK(application_request.is_pending());
+ app_.reset(new ApplicationImpl(this, application_request.Pass()));
+}
+
+bool NativeViewportApplicationLoader::ConfigureIncomingConnection(
+ ApplicationConnection* connection) {
+ connection->AddService<NativeViewport>(this);
+ connection->AddService<Gpu>(this);
+ connection->AddService<Keyboard>(this);
+ return true;
+}
+
+void NativeViewportApplicationLoader::Create(
+ ApplicationConnection* connection,
+ InterfaceRequest<NativeViewport> request) {
+ if (!gpu_state_)
+ gpu_state_ = new gles2::GpuState;
+ new native_viewport::NativeViewportImpl(false, gpu_state_, request.Pass());
+}
+
+void NativeViewportApplicationLoader::Create(
+ ApplicationConnection* connection,
+ InterfaceRequest<Keyboard> request) {
+ new KeyboardImpl(request.Pass());
+}
+
+void NativeViewportApplicationLoader::Create(ApplicationConnection* connection,
+ InterfaceRequest<Gpu> request) {
+ if (!gpu_state_)
+ gpu_state_ = new gles2::GpuState;
+ new gles2::GpuImpl(request.Pass(), gpu_state_);
+}
+
+} // namespace shell
+} // namespace mojo
« no previous file with comments | « mojo/shell/android/native_viewport_application_loader.h ('k') | mojo/shell/android/run_android_application_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698