| Index: android_webview/native/aw_contents.cc
|
| diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
|
| index be85577b629fc0e24a3c68c7db7523a5f0730a8b..bfe2e967317d128d0e4f23719bed417bd32231e7 100644
|
| --- a/android_webview/native/aw_contents.cc
|
| +++ b/android_webview/native/aw_contents.cc
|
| @@ -179,6 +179,13 @@ AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID(
|
| return aw_contents;
|
| }
|
|
|
| +// static
|
| +AwSafeBrowsingUIManager::UIManagerClient*
|
| +AwSafeBrowsingUIManager::UIManagerClient::FromWebContents(
|
| + WebContents* web_contents) {
|
| + return AwContents::FromWebContents(web_contents);
|
| +}
|
| +
|
| AwContents::AwContents(std::unique_ptr<WebContents> web_contents)
|
| : content::WebContentsObserver(web_contents.get()),
|
| functor_(nullptr),
|
| @@ -1287,6 +1294,8 @@ void AwContents::DidAttachInterstitialPage() {
|
|
|
| void AwContents::DidDetachInterstitialPage() {
|
| CompositorID compositor_id;
|
| + if (!web_contents_)
|
| + return;
|
| if (web_contents_->GetRenderProcessHost() &&
|
| web_contents_->GetRenderViewHost()) {
|
| compositor_id.process_id = web_contents_->GetRenderProcessHost()->GetID();
|
| @@ -1298,4 +1307,12 @@ void AwContents::DidDetachInterstitialPage() {
|
| browser_view_renderer_.SetActiveCompositorID(compositor_id);
|
| }
|
|
|
| +bool AwContents::CanShowInterstitial() {
|
| + JNIEnv* env = AttachCurrentThread();
|
| + const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
|
| + if (obj.is_null())
|
| + return false;
|
| + return Java_AwContents_canShowInterstitial(env, obj);
|
| +}
|
| +
|
| } // namespace android_webview
|
|
|