| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.tab; | 5 package org.chromium.chrome.browser.tab; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.Application; | 9 import android.app.Application; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 3009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3020 | 3020 |
| 3021 /** | 3021 /** |
| 3022 * @return Whether or not the tab was opened by an app other than Chrome. | 3022 * @return Whether or not the tab was opened by an app other than Chrome. |
| 3023 */ | 3023 */ |
| 3024 public boolean isCreatedForExternalApp() { | 3024 public boolean isCreatedForExternalApp() { |
| 3025 String packageName = ContextUtils.getApplicationContext().getPackageName
(); | 3025 String packageName = ContextUtils.getApplicationContext().getPackageName
(); |
| 3026 return getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP | 3026 return getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP |
| 3027 && !TextUtils.equals(getAppAssociatedWith(), packageName); | 3027 && !TextUtils.equals(getAppAssociatedWith(), packageName); |
| 3028 } | 3028 } |
| 3029 | 3029 |
| 3030 /** |
| 3031 * Set the Webapp manifest scope, which is used to allow frames within the s
cope to autoplay |
| 3032 * media unmuted. |
| 3033 */ |
| 3034 public void setWebappManifestScope(String scope) { |
| 3035 nativeSetWebappManifestScope(mNativeTabAndroid, scope); |
| 3036 } |
| 3037 |
| 3030 private native void nativeInit(); | 3038 private native void nativeInit(); |
| 3031 private native void nativeDestroy(long nativeTabAndroid); | 3039 private native void nativeDestroy(long nativeTabAndroid); |
| 3032 private native void nativeInitWebContents(long nativeTabAndroid, boolean inc
ognito, | 3040 private native void nativeInitWebContents(long nativeTabAndroid, boolean inc
ognito, |
| 3033 WebContents webContents, TabWebContentsDelegateAndroid delegate, | 3041 WebContents webContents, TabWebContentsDelegateAndroid delegate, |
| 3034 ContextMenuPopulator contextMenuPopulator); | 3042 ContextMenuPopulator contextMenuPopulator); |
| 3035 private native void nativeUpdateDelegates(long nativeTabAndroid, | 3043 private native void nativeUpdateDelegates(long nativeTabAndroid, |
| 3036 TabWebContentsDelegateAndroid delegate, ContextMenuPopulator context
MenuPopulator); | 3044 TabWebContentsDelegateAndroid delegate, ContextMenuPopulator context
MenuPopulator); |
| 3037 private native void nativeDestroyWebContents(long nativeTabAndroid, boolean
deleteNative); | 3045 private native void nativeDestroyWebContents(long nativeTabAndroid, boolean
deleteNative); |
| 3038 private native Profile nativeGetProfileAndroid(long nativeTabAndroid); | 3046 private native Profile nativeGetProfileAndroid(long nativeTabAndroid); |
| 3039 private native int nativeLoadUrl(long nativeTabAndroid, String url, String e
xtraHeaders, | 3047 private native int nativeLoadUrl(long nativeTabAndroid, String url, String e
xtraHeaders, |
| 3040 ResourceRequestBody postData, int transition, String referrerUrl, in
t referrerPolicy, | 3048 ResourceRequestBody postData, int transition, String referrerUrl, in
t referrerPolicy, |
| 3041 boolean isRendererInitiated, boolean shoulReplaceCurrentEntry, | 3049 boolean isRendererInitiated, boolean shoulReplaceCurrentEntry, |
| 3042 long intentReceivedTimestamp, boolean hasUserGesture); | 3050 long intentReceivedTimestamp, boolean hasUserGesture); |
| 3043 private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTab
Android, String url, | 3051 private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTab
Android, String url, |
| 3044 String title); | 3052 String title); |
| 3045 private native boolean nativePrint(long nativeTabAndroid); | 3053 private native boolean nativePrint(long nativeTabAndroid); |
| 3046 private native Bitmap nativeGetFavicon(long nativeTabAndroid); | 3054 private native Bitmap nativeGetFavicon(long nativeTabAndroid); |
| 3047 private native void nativeCreateHistoricalTab(long nativeTabAndroid); | 3055 private native void nativeCreateHistoricalTab(long nativeTabAndroid); |
| 3048 private native void nativeUpdateBrowserControlsState( | 3056 private native void nativeUpdateBrowserControlsState( |
| 3049 long nativeTabAndroid, int constraints, int current, boolean animate
); | 3057 long nativeTabAndroid, int constraints, int current, boolean animate
); |
| 3050 private native void nativeLoadOriginalImage(long nativeTabAndroid); | 3058 private native void nativeLoadOriginalImage(long nativeTabAndroid); |
| 3051 private native long nativeGetBookmarkId(long nativeTabAndroid, boolean onlyE
ditable); | 3059 private native long nativeGetBookmarkId(long nativeTabAndroid, boolean onlyE
ditable); |
| 3052 private native boolean nativeIsOfflinePage(long nativeTabAndroid); | 3060 private native boolean nativeIsOfflinePage(long nativeTabAndroid); |
| 3053 private native OfflinePageItem nativeGetOfflinePage(long nativeTabAndroid); | 3061 private native OfflinePageItem nativeGetOfflinePage(long nativeTabAndroid); |
| 3054 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, | 3062 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, |
| 3055 InterceptNavigationDelegate delegate); | 3063 InterceptNavigationDelegate delegate); |
| 3056 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 3064 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
| 3057 TabContentManager tabContentManager); | 3065 TabContentManager tabContentManager); |
| 3058 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); | 3066 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); |
| 3067 private native void nativeSetWebappManifestScope(long nativeTabAndroid, Stri
ng scope); |
| 3059 } | 3068 } |
| OLD | NEW |