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

Unified Diff: android_webview/native/aw_web_contents_delegate.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: android_webview/native/aw_web_contents_delegate.cc
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc
index 33e8edd88ed36b199d6a813613b3ce14291050de..8362a557c5d77050e8db7a24b528a0fc7924d752 100644
--- a/android_webview/native/aw_web_contents_delegate.cc
+++ b/android_webview/native/aw_web_contents_delegate.cc
@@ -10,8 +10,10 @@
#include "android_webview/native/aw_javascript_dialog_creator.h"
#include "content/public/browser/android/download_controller_android.h"
#include "content/public/browser/web_contents.h"
+#include "jni/AwWebContentsDelegate_jni.h"
#include "net/http/http_request_headers.h"
+using base::android::AttachCurrentThread;
using content::WebContents;
namespace android_webview {
@@ -64,4 +66,33 @@ void AwWebContentsDelegate::OnStartDownload(WebContents* source,
NOTREACHED(); // We always return false in CanDownload.
}
+void AwWebContentsDelegate::AddNewContents(content::WebContents* source,
joth 2012/11/14 18:34:52 this method is spurious: WebContentsDelegateAndroi
+ content::WebContents* new_contents,
joth 2012/11/14 18:34:52 wonky indent
benm (inactive) 2012/11/14 18:42:34 Done.
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture,
+ bool* was_blocked) {
+ DCHECK(was_blocked);
+ JNIEnv* env = AttachCurrentThread();
+
+ // TODO(benm): Need to plumb whether this popup window is a "dialog", for
+ // the Classic Android WebViews definition of "dialog".
+ bool is_dialog = false;
joth 2012/11/14 18:34:52 I'd just say is_dialog = (disposition == NEW_POPUP
benm (inactive) 2012/11/14 18:42:34 Done.
+ bool create_popup = Java_AwWebContentsDelegate_AddNewContents(env,
+ GetJavaDelegate(env).obj(), is_dialog, user_gesture);
+
+ if (create_popup) {
+ // TODO(benm): Implement :)
+ NOTIMPLEMENTED() << "Popup windows are currently not supported for"
+ << "the chromium powered Android WebView.";
+ *was_blocked = true;
+ } else {
+ *was_blocked = true;
+ }
+}
+
+bool RegisterAwWebContentsDelegate(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698