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

Unified Diff: android_webview/native/aw_contents.cc

Issue 2635693002: [WebView] initial webview-side implementation of safebrowsing (Closed)
Patch Set: rename lock, add crbug comment Created 3 years, 11 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: 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

Powered by Google App Engine
This is Rietveld 408576698