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

Unified Diff: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java

Issue 2762873003: Fix: long-tapping a WebAPK in recents shows Chrome.
Patch Set: Change back to CLEAR_TOP flag. Created 3 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: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java
diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..068f8ad15152937422c161233d5bcb03ecebc027
--- /dev/null
+++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/ShellActivity.java
@@ -0,0 +1,29 @@
+// Copyright 2017 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.webapk.shell_apk;
+
+import android.app.Activity;
+import android.os.Build;
+import android.os.Bundle;
+
+/**
+ * WebAPK's activity which launches host browser and is shown in recents on L+.
+ */
+public class ShellActivity extends Activity {
Yaron 2017/03/29 14:07:33 i think we need a better name for this. Perhaps so
Xi Han 2017/03/29 15:16:43 Done.
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
Yaron 2017/03/29 14:07:33 This should only be called on L+? Then why the con
Xi Han 2017/03/29 15:16:43 Removed. I though assert is used like DCHECK, isn'
+
+ LaunchWebApkHelper helper = new LaunchWebApkHelper();
+ if (!helper.launch(this)) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ finishAndRemoveTask();
+ } else {
+ finish();
+ }
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698