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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Page title may have changed, need to inform the embedder. | 211 // Page title may have changed, need to inform the embedder. |
212 // |source| may be null if loading has started. | 212 // |source| may be null if loading has started. |
213 JNIEnv* env = AttachCurrentThread(); | 213 JNIEnv* env = AttachCurrentThread(); |
214 | 214 |
215 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); | 215 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
216 if (java_delegate.obj()) { | 216 if (java_delegate.obj()) { |
217 Java_AwWebContentsDelegate_loadingStateChanged(env, java_delegate.obj()); | 217 Java_AwWebContentsDelegate_loadingStateChanged(env, java_delegate.obj()); |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
| 221 bool AwWebContentsDelegate::ShouldResumeRequestsForCreatedWindow() { |
| 222 // Always return false here since we need to defer loading the created window |
| 223 // until after we have attached a new delegate to the new webcontents (which |
| 224 // happens asynchronously). |
| 225 return false; |
| 226 } |
| 227 |
221 void AwWebContentsDelegate::RequestMediaAccessPermission( | 228 void AwWebContentsDelegate::RequestMediaAccessPermission( |
222 WebContents* web_contents, | 229 WebContents* web_contents, |
223 const content::MediaStreamRequest& request, | 230 const content::MediaStreamRequest& request, |
224 const content::MediaResponseCallback& callback) { | 231 const content::MediaResponseCallback& callback) { |
225 AwContents* aw_contents = AwContents::FromWebContents(web_contents); | 232 AwContents* aw_contents = AwContents::FromWebContents(web_contents); |
226 if (!aw_contents) { | 233 if (!aw_contents) { |
227 callback.Run(content::MediaStreamDevices(), | 234 callback.Run(content::MediaStreamDevices(), |
228 content::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, | 235 content::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, |
229 scoped_ptr<content::MediaStreamUI>().Pass()); | 236 scoped_ptr<content::MediaStreamUI>().Pass()); |
230 return; | 237 return; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 DVLOG(0) << "File Chooser result: mode = " << mode | 307 DVLOG(0) << "File Chooser result: mode = " << mode |
301 << ", file paths = " << base::JoinString(file_path_str, ":"); | 308 << ", file paths = " << base::JoinString(file_path_str, ":"); |
302 rvh->FilesSelectedInChooser(files, mode); | 309 rvh->FilesSelectedInChooser(files, mode); |
303 } | 310 } |
304 | 311 |
305 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 312 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
306 return RegisterNativesImpl(env); | 313 return RegisterNativesImpl(env); |
307 } | 314 } |
308 | 315 |
309 } // namespace android_webview | 316 } // namespace android_webview |
OLD | NEW |