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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11362183: [Android WebView] AwContentsClient.shouldCreateWindow callback part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits. Created 8 years, 1 month 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3408d0ac25759ae0bc6c71969f58b02b2665a53a..997a372b7848a3f914ee6837e63958dcb4d97d87 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1331,6 +1331,8 @@ void WebContentsImpl::CreateNewWindow(
PAGE_TRANSITION_LINK,
true /* is_renderer_initiated */);
new_contents->OpenURL(open_params);
+ } else {
+ delete new_contents;
}
}
}
@@ -1376,8 +1378,12 @@ void WebContentsImpl::ShowCreatedWindow(int route_id,
if (contents) {
WebContentsDelegate* delegate = GetDelegate();
if (delegate) {
+ bool was_blocked = false;
delegate->AddNewContents(
- this, contents, disposition, initial_pos, user_gesture, NULL);
+ this, contents, disposition, initial_pos, user_gesture, &was_blocked);
+ if (was_blocked) {
+ delete contents;
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698