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

Unified Diff: webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java

Issue 1965583002: Move //webapk to //chrome/android/webapk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java
diff --git a/webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java b/webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java
deleted file mode 100644
index 11adc9060458d4062e6c9a1e5f1f1730deeb5d9c..0000000000000000000000000000000000000000
--- a/webapk/libs/client/src/org/chromium/webapk/lib/client/NavigationClient.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2016 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.lib.client;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-
-import org.chromium.webapk.lib.common.WebApkConstants;
-import org.chromium.webapk.lib.common.WebApkUtils;
-
-/**
- * NavigationClient provides APIs that A WebAPK host can delegate a WebAPK to load URL.
- */
-public class NavigationClient {
- /**
- * Create an Intent to launch a WebAPK and return the Intent to the host.
- * @param webAPKPackageName the package name of the WebAPK to launch.
- * @param callerPackageName the package name of the host.
- * @param urlToNavigate the URL of the WebAPK to navigate.
- */
- public static Intent createIntentToLaunchWebAPK(String webAPKPackageName,
- String callerPackageName, String urlToNavigate) {
- Intent intent;
- try {
- intent = Intent.parseUri(urlToNavigate, Intent.URI_INTENT_SCHEME);
- } catch (Exception ex) {
- return null;
- }
- intent.setComponent(new ComponentName(webAPKPackageName,
- WebApkConstants.WEBAPK_MAIN_ACTIVITY));
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- return intent;
- }
-
- /**
- * When navigation is out of the scope of a WebAPK, the Activity hosted in the WebAPK can call
- * this function to create an Intent to ask its host to complete the navigation.
- * @param context a context instance.
- * @param urlToNavigate the URL for the navigation.
- * @param hostLauchActivity the Activity of the host that this Intent is sent to.
- */
- public static Intent createIntentToNavigateBackToHost(Context context,
- String urlToNavigate, String hostLauchActivity) {
- String hostPackageName = WebApkUtils.getHostBrowserPackageName(context);
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setComponent(new ComponentName(hostPackageName, hostLauchActivity));
- intent.setData(Uri.parse(urlToNavigate));
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- return intent;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698