| 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.support.v4.view.ViewCompat; |
| 21 import android.text.TextUtils; | 21 import android.text.TextUtils; |
| 22 import android.util.Log; | |
| 23 import android.view.ContextThemeWrapper; | 22 import android.view.ContextThemeWrapper; |
| 24 import android.view.View; | 23 import android.view.View; |
| 25 import android.view.View.OnClickListener; | 24 import android.view.View.OnClickListener; |
| 26 import android.view.ViewGroup; | 25 import android.view.ViewGroup; |
| 27 import android.view.accessibility.AccessibilityEvent; | 26 import android.view.accessibility.AccessibilityEvent; |
| 28 import android.widget.FrameLayout; | 27 import android.widget.FrameLayout; |
| 29 import android.widget.FrameLayout.LayoutParams; | 28 import android.widget.FrameLayout.LayoutParams; |
| 30 | 29 |
| 31 import org.chromium.base.ApiCompatibilityUtils; | 30 import org.chromium.base.ApiCompatibilityUtils; |
| 32 import org.chromium.base.ApplicationStatus; | 31 import org.chromium.base.ApplicationStatus; |
| 33 import org.chromium.base.ContextUtils; | 32 import org.chromium.base.ContextUtils; |
| 33 import org.chromium.base.Log; |
| 34 import org.chromium.base.ObserverList; | 34 import org.chromium.base.ObserverList; |
| 35 import org.chromium.base.ObserverList.RewindableIterator; | 35 import org.chromium.base.ObserverList.RewindableIterator; |
| 36 import org.chromium.base.TraceEvent; | 36 import org.chromium.base.TraceEvent; |
| 37 import org.chromium.base.VisibleForTesting; | 37 import org.chromium.base.VisibleForTesting; |
| 38 import org.chromium.base.annotations.CalledByNative; | 38 import org.chromium.base.annotations.CalledByNative; |
| 39 import org.chromium.base.metrics.RecordHistogram; | 39 import org.chromium.base.metrics.RecordHistogram; |
| 40 import org.chromium.chrome.R; | 40 import org.chromium.chrome.R; |
| 41 import org.chromium.chrome.browser.AppHooks; | 41 import org.chromium.chrome.browser.AppHooks; |
| 42 import org.chromium.chrome.browser.ChromeActionModeCallback; | 42 import org.chromium.chrome.browser.ChromeActionModeCallback; |
| 43 import org.chromium.chrome.browser.ChromeActivity; | 43 import org.chromium.chrome.browser.ChromeActivity; |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 TraceEvent.end("Tab.initialize"); | 1342 TraceEvent.end("Tab.initialize"); |
| 1343 } | 1343 } |
| 1344 } | 1344 } |
| 1345 | 1345 |
| 1346 /** | 1346 /** |
| 1347 * Begins the tab reparenting process. Detaches the tab from its current act
ivity and fires | 1347 * Begins the tab reparenting process. Detaches the tab from its current act
ivity and fires |
| 1348 * an Intent to reparent the tab into its new host activity. | 1348 * an Intent to reparent the tab into its new host activity. |
| 1349 * | 1349 * |
| 1350 * @param intent An optional intent with the desired component, flags, or ex
tras to use when | 1350 * @param intent An optional intent with the desired component, flags, or ex
tras to use when |
| 1351 * launching the new host activity. This intent's URI and acti
on will be | 1351 * launching the new host activity. This intent's URI and acti
on will be |
| 1352 * overriden. This may be null if no intent customization is n
eeded. | 1352 * overridden. This may be null if no intent customization is
needed. |
| 1353 * @param startActivityOptions Options to pass to {@link Activity#startActiv
ity(Intent, Bundle)} | 1353 * @param startActivityOptions Options to pass to {@link Activity#startActiv
ity(Intent, Bundle)} |
| 1354 * @param finalizeCallback A callback that will be called after the tab is a
ttached to the new | 1354 * @param finalizeCallback A callback that will be called after the tab is a
ttached to the new |
| 1355 * host activity in {@link #attachAndFinishReparenti
ng}. | 1355 * host activity in {@link #attachAndFinishReparenti
ng}. |
| 1356 * @return Whether reparenting succeeded. If false, the tab was not removed
and the intent was | 1356 * @return Whether reparenting succeeded. If false, the tab was not removed
and the intent was |
| 1357 * not fired. | 1357 * not fired. |
| 1358 */ | 1358 */ |
| 1359 public boolean detachAndStartReparenting(Intent intent, Bundle startActivity
Options, | 1359 public boolean detachAndStartReparenting(Intent intent, Bundle startActivity
Options, |
| 1360 Runnable finalizeCallback) { | 1360 Runnable finalizeCallback) { |
| 1361 ChromeActivity activity = getActivity(); | 1361 ChromeActivity activity = getActivity(); |
| 1362 if (activity == null) return false; | 1362 if (activity == null) return false; |
| (...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3087 private native boolean nativeIsOfflinePage(long nativeTabAndroid); | 3087 private native boolean nativeIsOfflinePage(long nativeTabAndroid); |
| 3088 private native OfflinePageItem nativeGetOfflinePage(long nativeTabAndroid); | 3088 private native OfflinePageItem nativeGetOfflinePage(long nativeTabAndroid); |
| 3089 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, | 3089 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, |
| 3090 InterceptNavigationDelegate delegate); | 3090 InterceptNavigationDelegate delegate); |
| 3091 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 3091 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
| 3092 TabContentManager tabContentManager); | 3092 TabContentManager tabContentManager); |
| 3093 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); | 3093 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String
url); |
| 3094 private native void nativeSetWebappManifestScope(long nativeTabAndroid, Stri
ng scope); | 3094 private native void nativeSetWebappManifestScope(long nativeTabAndroid, Stri
ng scope); |
| 3095 private native void nativeEnableEmbeddedMediaExperience(long nativeTabAndroi
d, boolean enabled); | 3095 private native void nativeEnableEmbeddedMediaExperience(long nativeTabAndroi
d, boolean enabled); |
| 3096 } | 3096 } |
| OLD | NEW |