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

Unified Diff: shell/android/native_viewport_application_loader.cc

Issue 810803003: Moves NativeViewportApplicationLoader into own files (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fix Created 6 years 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
« no previous file with comments | « shell/android/native_viewport_application_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/android/native_viewport_application_loader.cc
diff --git a/shell/android/native_viewport_application_loader.cc b/shell/android/native_viewport_application_loader.cc
new file mode 100644
index 0000000000000000000000000000000000000000..89f0f4e9fcb106bcc145d3fd691b028f16acade9
--- /dev/null
+++ b/shell/android/native_viewport_application_loader.cc
@@ -0,0 +1,54 @@
+// 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 "shell/android/native_viewport_application_loader.h"
+
+#include "mojo/public/cpp/application/application_impl.h"
+#include "services/native_viewport/native_viewport_impl.h"
+
+namespace mojo {
+namespace shell {
+
+NativeViewportApplicationLoader::NativeViewportApplicationLoader()
+ : gpu_state_(new gles2::GpuImpl::State) {
+}
+
+NativeViewportApplicationLoader::~NativeViewportApplicationLoader() {
+}
+
+void NativeViewportApplicationLoader::Load(ApplicationManager* manager,
+ const GURL& url,
+ ScopedMessagePipeHandle shell_handle,
+ LoadCallback callback) {
+ DCHECK(shell_handle.is_valid());
+ app_.reset(new ApplicationImpl(this, shell_handle.Pass()));
+}
+
+void NativeViewportApplicationLoader::OnApplicationError(
+ ApplicationManager* manager,
+ const GURL& url) {
+}
+
+bool NativeViewportApplicationLoader::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ connection->AddService<NativeViewport>(this);
+ connection->AddService<Gpu>(this);
+ return true;
+}
+
+void NativeViewportApplicationLoader::Create(
+ ApplicationConnection* connection,
+ InterfaceRequest<NativeViewport> request) {
+ BindToRequest(new native_viewport::NativeViewportImpl(app_.get(), false),
+ &request);
+}
+
+void NativeViewportApplicationLoader::Create(
+ ApplicationConnection* connection,
+ InterfaceRequest<Gpu> request) {
+ new gles2::GpuImpl(request.Pass(), gpu_state_);
+}
+
+} // namespace shell
+} // namespace mojo
« no previous file with comments | « shell/android/native_viewport_application_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698