| OLD | NEW |
| 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 "android_webview/browser/aw_javascript_dialog_manager.h" | 7 #include "android_webview/browser/aw_javascript_dialog_manager.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 "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 AwContents::FromWebContents(source)->SetPendingWebContentsForPopup( | 89 AwContents::FromWebContents(source)->SetPendingWebContentsForPopup( |
| 90 make_scoped_ptr(new_contents)); | 90 make_scoped_ptr(new_contents)); |
| 91 // Hide the WebContents for the pop up now, we will show it again | 91 // Hide the WebContents for the pop up now, we will show it again |
| 92 // when the user calls us back with an AwContents to use to show it. | 92 // when the user calls us back with an AwContents to use to show it. |
| 93 new_contents->WasHidden(); | 93 new_contents->WasHidden(); |
| 94 } else { | 94 } else { |
| 95 // The embedder has forgone their chance to display this popup | 95 // The embedder has forgone their chance to display this popup |
| 96 // window, so we're done with the WebContents now. We use | 96 // window, so we're done with the WebContents now. We use |
| 97 // DeleteSoon as WebContentsImpl may call methods on |new_contents| | 97 // DeleteSoon as WebContentsImpl may call methods on |new_contents| |
| 98 // after this method returns. | 98 // after this method returns. |
| 99 MessageLoop::current()->DeleteSoon(FROM_HERE, new_contents); | 99 base::MessageLoop::current()->DeleteSoon(FROM_HERE, new_contents); |
| 100 } | 100 } |
| 101 | 101 |
| 102 if (was_blocked) { | 102 if (was_blocked) { |
| 103 *was_blocked = !create_popup; | 103 *was_blocked = !create_popup; |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 void AwWebContentsDelegate::CloseContents(content::WebContents* source) { | 107 void AwWebContentsDelegate::CloseContents(content::WebContents* source) { |
| 108 JNIEnv* env = AttachCurrentThread(); | 108 JNIEnv* env = AttachCurrentThread(); |
| 109 | 109 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 131 return; | 131 return; |
| 132 return Java_AwWebContentsDelegate_updatePreferredSize( | 132 return Java_AwWebContentsDelegate_updatePreferredSize( |
| 133 env, obj.obj(), pref_size.width(), pref_size.height()); | 133 env, obj.obj(), pref_size.width(), pref_size.height()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 136 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 137 return RegisterNativesImpl(env); | 137 return RegisterNativesImpl(env); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace android_webview | 140 } // namespace android_webview |
| OLD | NEW |