[WebContents] Rename initialize to setDelegates
Bug: None Change-Id: Ie4bcf6d92d78d3607c5c7741df4645f5897f4cdb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5491352 Reviewed-by: Sean Topping <seantopping@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Peter Conn <peconn@chromium.org> Reviewed-by: David Trainor <dtrainor@chromium.org> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/main@{#1294358}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
bd9a6e59bb
commit
ce7a1bc90d
android_webview/java/src/org/chromium/android_webview
chrome
android
java
src
org
chromium
chrome
browser
compositor
bottombar
payments
tab
javatests
src
org
chromium
chrome
browser
browser
commerce
merchant_viewer
android
java
src
org
chromium
chrome
browser
merchant_viewer
creator
android
java
src
org
chromium
chrome
browser
creator
chromecast/browser/android/apk/src/org/chromium/chromecast/shell
content
public
android
java
src
org
chromium
test
android
javatests
src
org
chromium
content_public
browser
test
shell
android
java
src
org
chromium
content_shell
@ -1398,7 +1398,7 @@ public class AwContents implements SmartClipProvider {
|
||||
WindowAndroid windowAndroid,
|
||||
WebContentsInternalsHolder internalsHolder,
|
||||
AwSelectionActionMenuDelegate selectionActionMenuDelegate) {
|
||||
webContents.initialize(
|
||||
webContents.setDelegates(
|
||||
PRODUCT_VERSION, viewDelegate, internalDispatcher, windowAndroid, internalsHolder);
|
||||
mViewEventSink = ViewEventSink.from(mWebContents);
|
||||
mViewEventSink.setHideKeyboardOnBlur(false);
|
||||
|
@ -394,7 +394,7 @@ public class OverlayPanelContent {
|
||||
}
|
||||
|
||||
OverlayViewDelegate delegate = new OverlayViewDelegate(cv);
|
||||
mWebContents.initialize(
|
||||
mWebContents.setDelegates(
|
||||
VersionInfo.getProductVersion(),
|
||||
delegate,
|
||||
cv,
|
||||
|
@ -233,7 +233,7 @@ public class EphemeralTabCoordinator implements View.OnLayoutChangeListener {
|
||||
ContentView.createContentView(
|
||||
mContext, /* eventOffsetHandler= */ null, mWebContents);
|
||||
|
||||
mWebContents.initialize(
|
||||
mWebContents.setDelegates(
|
||||
VersionInfo.getProductVersion(),
|
||||
ViewAndroidDelegate.createBasicDelegate(mContentView),
|
||||
mContentView,
|
||||
|
2
chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java
2
chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java
@ -161,7 +161,7 @@ public class PaymentHandlerCoordinator {
|
||||
|
||||
private void initializeWebContents(
|
||||
WindowAndroid windowAndroid, ContentView webContentView, GURL url) {
|
||||
mPaymentHandlerWebContents.initialize(
|
||||
mPaymentHandlerWebContents.setDelegates(
|
||||
VersionInfo.getProductVersion(),
|
||||
ViewAndroidDelegate.createBasicDelegate(webContentView),
|
||||
webContentView,
|
||||
|
@ -1596,7 +1596,7 @@ class TabImpl implements Tab {
|
||||
.getResources()
|
||||
.getString(R.string.accessibility_content_view));
|
||||
mContentView = cv;
|
||||
webContents.initialize(
|
||||
webContents.setDelegates(
|
||||
PRODUCT_VERSION,
|
||||
new TabViewAndroidDelegate(this, cv),
|
||||
cv,
|
||||
@ -2062,7 +2062,7 @@ class TabImpl implements Tab {
|
||||
// This call is just a workaround, Chrome should clean up the WebContentsObservers
|
||||
// itself.
|
||||
contentsToDestroy.clearJavaWebContentsObservers();
|
||||
contentsToDestroy.initialize(
|
||||
contentsToDestroy.setDelegates(
|
||||
PRODUCT_VERSION,
|
||||
ViewAndroidDelegate.createBasicDelegate(/* containerView= */ null),
|
||||
/* accessDelegate= */ null,
|
||||
|
@ -144,7 +144,7 @@ public class ContextualSearchInstrumentationBase {
|
||||
ContentView cv =
|
||||
ContentView.createContentView(
|
||||
activity, /* eventOffsetHandler= */ null, webContents);
|
||||
webContents.initialize(
|
||||
webContents.setDelegates(
|
||||
null,
|
||||
ViewAndroidDelegate.createBasicDelegate(cv),
|
||||
null,
|
||||
|
2
chrome/android/javatests/src/org/chromium/chrome/browser/input/SelectPopupOtherContentViewTest.java
2
chrome/android/javatests/src/org/chromium/chrome/browser/input/SelectPopupOtherContentViewTest.java
@ -91,7 +91,7 @@ public class SelectPopupOtherContentViewTest {
|
||||
ContentView cv =
|
||||
ContentView.createContentView(
|
||||
activity, /* eventOffsetHandler= */ null, webContents);
|
||||
webContents.initialize(
|
||||
webContents.setDelegates(
|
||||
"",
|
||||
ViewAndroidDelegate.createBasicDelegate(cv),
|
||||
cv,
|
||||
|
@ -217,7 +217,7 @@ public class MerchantTrustBottomSheetMediator {
|
||||
mWebContentView = ContentView.createContentView(mContext, null, mWebContents);
|
||||
final ViewAndroidDelegate delegate =
|
||||
ViewAndroidDelegate.createBasicDelegate(mWebContentView);
|
||||
mWebContents.initialize(
|
||||
mWebContents.setDelegates(
|
||||
VersionInfo.getProductVersion(),
|
||||
delegate,
|
||||
mWebContentView,
|
||||
|
2
chrome/browser/creator/android/java/src/org/chromium/chrome/browser/creator/CreatorCoordinator.java
2
chrome/browser/creator/android/java/src/org/chromium/chrome/browser/creator/CreatorCoordinator.java
@ -603,7 +603,7 @@ public class CreatorCoordinator
|
||||
ContentView.createContentView(
|
||||
mActivity, /* eventOffsetHandler= */ null, mWebContents);
|
||||
|
||||
mWebContents.initialize(
|
||||
mWebContents.setDelegates(
|
||||
VersionInfo.getProductVersion(),
|
||||
ViewAndroidDelegate.createBasicDelegate(mContentView),
|
||||
mContentView,
|
||||
|
@ -49,8 +49,12 @@ public class WebContentsRegistry {
|
||||
if (holder.webContents.equals(webContents)) {
|
||||
if (!holder.initialized) {
|
||||
// TODO(derekjchow): productVersion
|
||||
webContents.initialize("", ViewAndroidDelegate.createBasicDelegate(contentView),
|
||||
contentView, window, WebContents.createDefaultInternalsHolder());
|
||||
webContents.setDelegates(
|
||||
"",
|
||||
ViewAndroidDelegate.createBasicDelegate(contentView),
|
||||
contentView,
|
||||
window,
|
||||
WebContents.createDefaultInternalsHolder());
|
||||
} else {
|
||||
webContents.getViewAndroidDelegate().setContainerView(contentView);
|
||||
webContents.setTopLevelNativeWindow(window);
|
||||
@ -60,4 +64,4 @@ public class WebContentsRegistry {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ public class WebContentsImpl implements WebContents, RenderFrameHostDelegate, Wi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(
|
||||
public void setDelegates(
|
||||
String productVersion,
|
||||
ViewAndroidDelegate viewDelegate,
|
||||
InternalAccessDelegate accessDelegate,
|
||||
|
@ -82,7 +82,6 @@ public interface WebContents extends Parcelable {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO(ctzsm): Rename this method to setDelegates()
|
||||
*
|
||||
* Initialize various content objects of {@link WebContents} lifetime.
|
||||
*
|
||||
@ -96,7 +95,7 @@ public interface WebContents extends Parcelable {
|
||||
* @param windowAndroid An instance of the WindowAndroid.
|
||||
* @param internalsHolder A holder of objects used internally by WebContents.
|
||||
*/
|
||||
void initialize(
|
||||
void setDelegates(
|
||||
String productVersion,
|
||||
ViewAndroidDelegate viewDelegate,
|
||||
ViewEventSink.InternalAccessDelegate accessDelegate,
|
||||
|
@ -43,7 +43,7 @@ public class MockWebContents implements WebContents {
|
||||
private GURL mLastCommittedUrl;
|
||||
|
||||
@Override
|
||||
public void initialize(
|
||||
public void setDelegates(
|
||||
String productVersion,
|
||||
ViewAndroidDelegate viewDelegate,
|
||||
ViewEventSink.InternalAccessDelegate accessDelegate,
|
||||
|
@ -313,7 +313,7 @@ public class Shell extends LinearLayout {
|
||||
mViewAndroidDelegate = new ShellViewAndroidDelegate(cv);
|
||||
assert (mWebContents != webContents);
|
||||
if (mWebContents != null) mWebContents.clearNativeReference();
|
||||
webContents.initialize(
|
||||
webContents.setDelegates(
|
||||
"", mViewAndroidDelegate, cv, mWindow, WebContents.createDefaultInternalsHolder());
|
||||
mWebContents = webContents;
|
||||
SelectionPopupController.fromWebContents(webContents)
|
||||
|
Reference in New Issue
Block a user