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; |
11 import android.content.Intent; | 11 import android.content.Intent; |
12 import android.content.res.Resources; | 12 import android.content.res.Resources; |
13 import android.graphics.Bitmap; | 13 import android.graphics.Bitmap; |
14 import android.graphics.Color; | 14 import android.graphics.Color; |
15 import android.graphics.Rect; | 15 import android.graphics.Rect; |
16 import android.net.Uri; | 16 import android.net.Uri; |
17 import android.os.Bundle; | 17 import android.os.Bundle; |
18 import android.provider.Browser; | 18 import android.provider.Browser; |
19 import android.support.annotation.Nullable; | 19 import android.support.annotation.Nullable; |
| 20 import android.support.v4.view.ViewCompat; |
20 import android.text.TextUtils; | 21 import android.text.TextUtils; |
21 import android.util.Log; | 22 import android.util.Log; |
22 import android.view.ContextThemeWrapper; | 23 import android.view.ContextThemeWrapper; |
23 import android.view.View; | 24 import android.view.View; |
24 import android.view.View.OnClickListener; | 25 import android.view.View.OnClickListener; |
25 import android.view.ViewGroup; | 26 import android.view.ViewGroup; |
26 import android.view.accessibility.AccessibilityEvent; | 27 import android.view.accessibility.AccessibilityEvent; |
27 import android.widget.FrameLayout; | 28 import android.widget.FrameLayout; |
28 import android.widget.FrameLayout.LayoutParams; | 29 import android.widget.FrameLayout.LayoutParams; |
29 | 30 |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 } | 2131 } |
2131 | 2132 |
2132 /** | 2133 /** |
2133 * @return Whether or not the tab is hidden. | 2134 * @return Whether or not the tab is hidden. |
2134 */ | 2135 */ |
2135 public boolean isHidden() { | 2136 public boolean isHidden() { |
2136 return mIsHidden; | 2137 return mIsHidden; |
2137 } | 2138 } |
2138 | 2139 |
2139 /** | 2140 /** |
| 2141 * @return Whether the tab can currently be interacted with by the user. Th
is requires the |
| 2142 * view owned by the Tab to be visible and in a state where the user
can interact with |
| 2143 * it (i.e. not in something like the phone tab switcher). |
| 2144 */ |
| 2145 @CalledByNative |
| 2146 public boolean isUserInteractable() { |
| 2147 return !mIsHidden && ViewCompat.isAttachedToWindow(getView()); |
| 2148 } |
| 2149 |
| 2150 /** |
2140 * @return Whether or not the tab is in the closing process. | 2151 * @return Whether or not the tab is in the closing process. |
2141 */ | 2152 */ |
2142 public boolean isClosing() { | 2153 public boolean isClosing() { |
2143 return mIsClosing; | 2154 return mIsClosing; |
2144 } | 2155 } |
2145 | 2156 |
2146 /** | 2157 /** |
2147 * @param closing Whether or not the tab is in the closing process. | 2158 * @param closing Whether or not the tab is in the closing process. |
2148 */ | 2159 */ |
2149 public void setClosing(boolean closing) { | 2160 public void setClosing(boolean closing) { |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3090 private native void nativeLoadOriginalImage(long nativeTabAndroid); | 3101 private native void nativeLoadOriginalImage(long nativeTabAndroid); |
3091 private native long nativeGetBookmarkId(long nativeTabAndroid, boolean onlyE
ditable); | 3102 private native long nativeGetBookmarkId(long nativeTabAndroid, boolean onlyE
ditable); |
3092 private native boolean nativeIsOfflinePage(long nativeTabAndroid); | 3103 private native boolean nativeIsOfflinePage(long nativeTabAndroid); |
3093 private native OfflinePageItem nativeGetOfflinePage(long nativeTabAndroid); | 3104 private native OfflinePageItem nativeGetOfflinePage(long nativeTabAndroid); |
3094 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, | 3105 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, |
3095 InterceptNavigationDelegate delegate); | 3106 InterceptNavigationDelegate delegate); |
3096 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 3107 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
3097 TabContentManager tabContentManager); | 3108 TabContentManager tabContentManager); |
3098 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); | 3109 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); |
3099 } | 3110 } |
OLD | NEW |