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

Side by Side Diff: android_webview/native/aw_web_contents_delegate.cc

Issue 11348075: [Android WebView] AwContentsClient.shouldCreate window callback part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/native/aw_web_contents_delegate.h" 5 #include "android_webview/native/aw_web_contents_delegate.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "android_webview/browser/find_helper.h" 8 #include "android_webview/browser/find_helper.h"
9 #include "android_webview/native/aw_contents.h" 9 #include "android_webview/native/aw_contents.h"
10 #include "android_webview/native/aw_javascript_dialog_creator.h" 10 #include "android_webview/native/aw_javascript_dialog_creator.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const gfx::Rect& initial_pos, 72 const gfx::Rect& initial_pos,
73 bool user_gesture, 73 bool user_gesture,
74 bool* was_blocked) { 74 bool* was_blocked) {
75 JNIEnv* env = AttachCurrentThread(); 75 JNIEnv* env = AttachCurrentThread();
76 76
77 bool is_dialog = disposition == NEW_POPUP; 77 bool is_dialog = disposition == NEW_POPUP;
78 bool create_popup = Java_AwWebContentsDelegate_addNewContents(env, 78 bool create_popup = Java_AwWebContentsDelegate_addNewContents(env,
79 GetJavaDelegate(env).obj(), is_dialog, user_gesture); 79 GetJavaDelegate(env).obj(), is_dialog, user_gesture);
80 80
81 if (create_popup) { 81 if (create_popup) {
82 // TODO(benm): Implement, taking ownership of new_contents. 82 // The embedder would like to display the popup and we will receive
83 NOTIMPLEMENTED() << "Popup windows are currently not supported for " 83 // a callback from them later with an AwContents to use to displau
joth 2012/11/16 06:24:31 typo: dispau
benm (inactive) 2012/11/16 12:29:09 Done.
84 << "the chromium powered Android WebView."; 84 // it. The source AwContents takes ownership of the new WebContents
85 // until then, at which point we will swap it out into the new
86 // AwContents.
87 AwContents::FromWebContents(source)->SetPendingWebContentsForPopup(
88 new_contents);
89 new_contents->WasHidden();
85 } else { 90 } else {
86 // The embedder has forgone their chance to display this popup 91 // The embedder has forgone their chance to display this popup
87 // window, so we're done with the WebContents now. 92 // window, so we're done with the WebContents now.
88 delete new_contents; 93 delete new_contents;
89 } 94 }
90 95
91 if (was_blocked) { 96 if (was_blocked) {
92 *was_blocked = !create_popup; 97 *was_blocked = !create_popup;
93 } 98 }
94 } 99 }
95 100
96 bool RegisterAwWebContentsDelegate(JNIEnv* env) { 101 bool RegisterAwWebContentsDelegate(JNIEnv* env) {
97 return RegisterNativesImpl(env); 102 return RegisterNativesImpl(env);
98 } 103 }
99 104
100 } // namespace android_webview 105 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698