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, ...@@ -322,6 +322,8 @@ class AwContents : public FindHelper::Listener,
jboolean include_disk_files); jboolean include_disk_files);
void KillRenderProcess(JNIEnv* env, void KillRenderProcess(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj); const base::android::JavaParamRef<jobject>& obj);
// See //android_webview/docs/how-does-on-create-window-work.md for more
// details.
void SetPendingWebContentsForPopup( void SetPendingWebContentsForPopup(
std::unique_ptr<content::WebContents> pending); std::unique_ptr<content::WebContents> pending);
jlong ReleasePopupAwContents(JNIEnv* env, jlong ReleasePopupAwContents(JNIEnv* env,
...@@ -413,6 +415,8 @@ class AwContents : public FindHelper::Listener, ...@@ -413,6 +415,8 @@ class AwContents : public FindHelper::Listener,
std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_; std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_;
std::unique_ptr<FindHelper> find_helper_; std::unique_ptr<FindHelper> find_helper_;
std::unique_ptr<IconHelper> icon_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<AwContents> pending_contents_;
std::unique_ptr<AwPdfExporter> pdf_exporter_; std::unique_ptr<AwPdfExporter> pdf_exporter_;
std::unique_ptr<PermissionRequestHandler> permission_request_handler_; std::unique_ptr<PermissionRequestHandler> permission_request_handler_;
......
...@@ -41,6 +41,8 @@ class AwWebContentsDelegate ...@@ -41,6 +41,8 @@ class AwWebContentsDelegate
void RunFileChooser(content::RenderFrameHost* render_frame_host, void RunFileChooser(content::RenderFrameHost* render_frame_host,
std::unique_ptr<content::FileSelectListener> listener, std::unique_ptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override; 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, void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents, std::unique_ptr<content::WebContents> new_contents,
WindowOpenDisposition disposition, WindowOpenDisposition disposition,
......
...@@ -265,6 +265,7 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate ...@@ -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) { static void completeWindowCreation(WebView parent, WebView child) {
AwContents parentContents = ((WebViewChromium) parent.getWebViewProvider()).mAwContents; AwContents parentContents = ((WebViewChromium) parent.getWebViewProvider()).mAwContents;
AwContents childContents = AwContents childContents =
......
...@@ -111,6 +111,7 @@ class WebViewContentsClientAdapter extends SharedWebViewContentsClientAdapter { ...@@ -111,6 +111,7 @@ class WebViewContentsClientAdapter extends SharedWebViewContentsClientAdapter {
super(webView, webViewDelegate, context); super(webView, webViewDelegate, context);
try (ScopedSysTraceEvent event = try (ScopedSysTraceEvent event =
ScopedSysTraceEvent.scoped("WebViewContentsClientAdapter.constructor")) { ScopedSysTraceEvent.scoped("WebViewContentsClientAdapter.constructor")) {
// See //android_webview/docs/how-does-on-create-window-work.md for more details.
mUiThreadHandler = new Handler() { mUiThreadHandler = new Handler() {
@Override @Override
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
......
...@@ -1296,6 +1296,8 @@ public class AwContents implements SmartClipProvider { ...@@ -1296,6 +1296,8 @@ public class AwContents implements SmartClipProvider {
/** /**
* Called on the "source" AwContents that is opening the popup window to * Called on the "source" AwContents that is opening the popup window to
* provide the AwContents to host the pop up content. * 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) { public void supplyContentsForPopup(AwContents newContents) {
if (isDestroyed(WARN)) return; if (isDestroyed(WARN)) return;
...@@ -1316,6 +1318,7 @@ public class AwContents implements SmartClipProvider { ...@@ -1316,6 +1318,7 @@ public class AwContents implements SmartClipProvider {
// Recap: supplyContentsForPopup() is called on the parent window's content, this method is // Recap: supplyContentsForPopup() is called on the parent window's content, this method is
// called on the popup window's content. // 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) { private void receivePopupContents(long popupNativeAwContents) {
if (isDestroyed(WARN)) return; if (isDestroyed(WARN)) return;
// Save existing view state. // Save existing view state.
......
...@@ -25,6 +25,7 @@ public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid { ...@@ -25,6 +25,7 @@ public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid {
public abstract void runFileChooser(int processId, int renderId, int modeFlags, public abstract void runFileChooser(int processId, int renderId, int modeFlags,
String acceptTypes, String title, String defaultFilename, boolean capture); String acceptTypes, String title, String defaultFilename, boolean capture);
// See //android_webview/docs/how-does-on-create-window-work.md for more details.
@CalledByNative @CalledByNative
public abstract boolean addNewContents(boolean isDialog, boolean isUserGesture); 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