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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Issue 2804953003: Refactor ContentViewClient (6/6) (Closed)
Patch Set: Created 3 years, 8 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/java/src/org/chromium/chrome/browser/tab/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
index d3de2ebd4f8698e44b0f77ab109acb9a64c2e573..6f145e4adbe9b5ce5a4eca0bc9cec47229de6fd0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -90,7 +90,6 @@ import org.chromium.components.navigation_interception.InterceptNavigationDelega
import org.chromium.components.security_state.ConnectionSecurityLevel;
import org.chromium.content.browser.ChildProcessLauncher;
import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.crypto.CipherFactory;
import org.chromium.content_public.browser.GestureStateListener;
@@ -193,7 +192,6 @@ public class Tab
private final ObserverList<TabObserver> mObservers = new ObserverList<>();
// Content layer Observers and Delegates
- private ContentViewClient mContentViewClient;
private TabWebContentsObserver mWebContentsObserver;
private TabWebContentsDelegateAndroid mWebContentsDelegate;
@@ -373,17 +371,6 @@ public class Tab
/** Whether or not the tab closing the tab can send the user back to the app that opened it. */
private boolean mIsAllowedToReturnToExternalApp;
- private class TabContentViewClient extends ContentViewClient {
- @Override
- public int getSystemWindowInsetBottom() {
- ChromeActivity activity = getActivity();
- if (activity != null && activity.getInsetObserverView() != null) {
- return activity.getInsetObserverView().getSystemWindowInsetsBottom();
- }
- return 0;
- }
- }
-
private GestureStateListener createGestureStateListener() {
return new GestureStateListener() {
@Override
@@ -510,8 +497,6 @@ public class Tab
restoreFieldsFromState(frozenState);
}
- setContentViewClient(new TabContentViewClient());
-
mTabRedirectHandler = new TabRedirectHandler(mThemedApplicationContext);
addObserver(mTabObserver);
@@ -1086,26 +1071,6 @@ public class Tab
}
/**
- * @param client The {@link ContentViewClient} to be bound to any current or new
- * {@link ContentViewCore}s associated with this {@link Tab}.
- */
- private void setContentViewClient(ContentViewClient client) {
- if (mContentViewClient == client) return;
-
- ContentViewClient oldClient = mContentViewClient;
- mContentViewClient = client;
-
- if (mContentViewCore == null) return;
-
- if (mContentViewClient != null) {
- mContentViewCore.setContentViewClient(mContentViewClient);
- } else if (oldClient != null) {
- // We can't set a null client, but we should clear references to the last one.
- mContentViewCore.setContentViewClient(new ContentViewClient());
- }
- }
-
- /**
* Called on the foreground tab when the Activity showing the Tab gets started. This is called
* on both cold and warm starts.
*/
@@ -1624,10 +1589,6 @@ public class Tab
mWebContentsObserver =
new TabWebContentsObserver(mContentViewCore.getWebContents(), this);
- if (mContentViewClient != null) {
- mContentViewCore.setContentViewClient(mContentViewClient);
- }
-
mDownloadDelegate = new ChromeDownloadDelegate(mThemedApplicationContext, this);
assert mNativeTabAndroid != 0;

Powered by Google App Engine
This is Rietveld 408576698