| 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 "android_webview/native/aw_contents_io_thread_client_impl.h" | 10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (create_popup) { | 144 if (create_popup) { |
| 145 // The embedder would like to display the popup and we will receive | 145 // The embedder would like to display the popup and we will receive |
| 146 // a callback from them later with an AwContents to use to display | 146 // a callback from them later with an AwContents to use to display |
| 147 // it. The source AwContents takes ownership of the new WebContents | 147 // it. The source AwContents takes ownership of the new WebContents |
| 148 // until then, and when the callback is made we will swap the WebContents | 148 // until then, and when the callback is made we will swap the WebContents |
| 149 // out into the new AwContents. | 149 // out into the new AwContents. |
| 150 AwContents::FromWebContents(source)->SetPendingWebContentsForPopup( | 150 AwContents::FromWebContents(source)->SetPendingWebContentsForPopup( |
| 151 make_scoped_ptr(new_contents)); | 151 make_scoped_ptr(new_contents)); |
| 152 // Hide the WebContents for the pop up now, we will show it again | 152 // Hide the WebContents for the pop up now, we will show it again |
| 153 // when the user calls us back with an AwContents to use to show it. | 153 // when the user calls us back with an AwContents to use to show it. |
| 154 new_contents->WasHidden(); | 154 new_contents->MarkBackgrounded(); |
| 155 } else { | 155 } else { |
| 156 // The embedder has forgone their chance to display this popup | 156 // The embedder has forgone their chance to display this popup |
| 157 // window, so we're done with the WebContents now. We use | 157 // window, so we're done with the WebContents now. We use |
| 158 // DeleteSoon as WebContentsImpl may call methods on |new_contents| | 158 // DeleteSoon as WebContentsImpl may call methods on |new_contents| |
| 159 // after this method returns. | 159 // after this method returns. |
| 160 base::MessageLoop::current()->DeleteSoon(FROM_HERE, new_contents); | 160 base::MessageLoop::current()->DeleteSoon(FROM_HERE, new_contents); |
| 161 } | 161 } |
| 162 | 162 |
| 163 if (was_blocked) { | 163 if (was_blocked) { |
| 164 *was_blocked = !create_popup; | 164 *was_blocked = !create_popup; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 DVLOG(0) << "File Chooser result: mode = " << mode | 307 DVLOG(0) << "File Chooser result: mode = " << mode |
| 308 << ", file paths = " << base::JoinString(file_path_str, ":"); | 308 << ", file paths = " << base::JoinString(file_path_str, ":"); |
| 309 rvh->FilesSelectedInChooser(files, mode); | 309 rvh->FilesSelectedInChooser(files, mode); |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 312 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 313 return RegisterNativesImpl(env); | 313 return RegisterNativesImpl(env); |
| 314 } | 314 } |
| 315 | 315 |
| 316 } // namespace android_webview | 316 } // namespace android_webview |
| OLD | NEW |