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

Unified Diff: blimp/client/android/java/src/org/chromium/blimp/BlimpRendererActivity.java

Issue 1295243003: Initial commit of the blimp/ folder and target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address final nits. Created 5 years, 3 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: blimp/client/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
diff --git a/blimp/client/android/java/src/org/chromium/blimp/BlimpRendererActivity.java b/blimp/client/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..7cc4e66f4e51f6a7373124b3f06c1007b531efd0
--- /dev/null
+++ b/blimp/client/android/java/src/org/chromium/blimp/BlimpRendererActivity.java
@@ -0,0 +1,56 @@
+// Copyright 2015 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.
+
+package org.chromium.blimp;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+import org.chromium.base.Log;
+import org.chromium.base.library_loader.ProcessInitException;
+
+/**
+ * The {@link Activity} for rendering the main Blimp client. This loads the Blimp rendering stack
+ * and displays it.
+ */
+public class BlimpRendererActivity extends Activity implements BlimpLibraryLoader.Callback {
+ private static final String TAG = "cr.Blimp";
+ private BlimpView mBlimpView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ try {
+ BlimpLibraryLoader.startAsync(this, this);
+ } catch (ProcessInitException e) {
+ Log.e(TAG, "Native startup exception", e);
+ System.exit(-1);
+ return;
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ if (mBlimpView != null) {
+ mBlimpView.destroyRenderer();
+ mBlimpView = null;
+ }
+
+ super.onDestroy();
+ }
+
+ // BlimpLibraryLoader.Callback implementation.
+ @Override
+ public void onStartupComplete(boolean success) {
+ if (!success) {
+ Log.e(TAG, "Native startup failed");
+ finish();
+ return;
+ }
+
+ setContentView(R.layout.blimp_main);
+ mBlimpView = (BlimpView) findViewById(R.id.renderer);
+ mBlimpView.initializeRenderer();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698