Commit a1905160 authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

aw: Document WebChromeClient#onCreateWindow()

Pointing the related code to the newly added doc.

Bug: 1063189
Test: No logic change.
Change-Id: I5fa3bdebe521b49a8f32241e4406ac9c072ec302
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107569Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753425}
parent 2f79b383
......@@ -322,6 +322,8 @@ class AwContents : public FindHelper::Listener,
jboolean include_disk_files);
void KillRenderProcess(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
// See //android_webview/docs/how-does-on-create-window-work.md for more
// details.
void SetPendingWebContentsForPopup(
std::unique_ptr<content::WebContents> pending);
jlong ReleasePopupAwContents(JNIEnv* env,
......@@ -413,6 +415,8 @@ class AwContents : public FindHelper::Listener,
std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_;
std::unique_ptr<FindHelper> find_helper_;
std::unique_ptr<IconHelper> icon_helper_;
// See //android_webview/docs/how-does-on-create-window-work.md for more
// details for |pending_contents_|.
std::unique_ptr<AwContents> pending_contents_;
std::unique_ptr<AwPdfExporter> pdf_exporter_;
std::unique_ptr<PermissionRequestHandler> permission_request_handler_;
......
......@@ -41,6 +41,8 @@ class AwWebContentsDelegate
void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
// See //android_webview/docs/how-does-on-create-window-work.md for more
// details.
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
WindowOpenDisposition disposition,
......
......@@ -265,6 +265,7 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate
}
}
// See //android_webview/docs/how-does-on-create-window-work.md for more details.
static void completeWindowCreation(WebView parent, WebView child) {
AwContents parentContents = ((WebViewChromium) parent.getWebViewProvider()).mAwContents;
AwContents childContents =
......
......@@ -111,6 +111,7 @@ class WebViewContentsClientAdapter extends SharedWebViewContentsClientAdapter {
super(webView, webViewDelegate, context);
try (ScopedSysTraceEvent event =
ScopedSysTraceEvent.scoped("WebViewContentsClientAdapter.constructor")) {
// See //android_webview/docs/how-does-on-create-window-work.md for more details.
mUiThreadHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
......
......@@ -1296,6 +1296,8 @@ public class AwContents implements SmartClipProvider {
/**
* Called on the "source" AwContents that is opening the popup window to
* provide the AwContents to host the pop up content.
*
* See //android_webview/docs/how-does-on-create-window-work.md for more details.
*/
public void supplyContentsForPopup(AwContents newContents) {
if (isDestroyed(WARN)) return;
......@@ -1316,6 +1318,7 @@ public class AwContents implements SmartClipProvider {
// Recap: supplyContentsForPopup() is called on the parent window's content, this method is
// called on the popup window's content.
// See //android_webview/docs/how-does-on-create-window-work.md for more details.
private void receivePopupContents(long popupNativeAwContents) {
if (isDestroyed(WARN)) return;
// Save existing view state.
......
......@@ -25,6 +25,7 @@ public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid {
public abstract void runFileChooser(int processId, int renderId, int modeFlags,
String acceptTypes, String title, String defaultFilename, boolean capture);
// See //android_webview/docs/how-does-on-create-window-work.md for more details.
@CalledByNative
public abstract boolean addNewContents(boolean isDialog, boolean isUserGesture);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment