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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 void AwWebContentsDelegate::ActivateContents(WebContents* contents) { | 198 void AwWebContentsDelegate::ActivateContents(WebContents* contents) { |
199 JNIEnv* env = AttachCurrentThread(); | 199 JNIEnv* env = AttachCurrentThread(); |
200 | 200 |
201 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); | 201 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
202 if (java_delegate.obj()) { | 202 if (java_delegate.obj()) { |
203 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); | 203 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
| 207 void AwWebContentsDelegate::LoadingStateChanged(WebContents* source, |
| 208 bool to_different_document) { |
| 209 // Page title may have changed, need to inform the embedder. |
| 210 // |source| may be null if loading has started. |
| 211 JNIEnv* env = AttachCurrentThread(); |
| 212 |
| 213 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
| 214 if (java_delegate.obj()) { |
| 215 Java_AwWebContentsDelegate_loadingStateChanged(env, java_delegate.obj()); |
| 216 } |
| 217 } |
| 218 |
207 void AwWebContentsDelegate::RequestMediaAccessPermission( | 219 void AwWebContentsDelegate::RequestMediaAccessPermission( |
208 WebContents* web_contents, | 220 WebContents* web_contents, |
209 const content::MediaStreamRequest& request, | 221 const content::MediaStreamRequest& request, |
210 const content::MediaResponseCallback& callback) { | 222 const content::MediaResponseCallback& callback) { |
211 AwContents* aw_contents = AwContents::FromWebContents(web_contents); | 223 AwContents* aw_contents = AwContents::FromWebContents(web_contents); |
212 if (!aw_contents) { | 224 if (!aw_contents) { |
213 callback.Run(content::MediaStreamDevices(), | 225 callback.Run(content::MediaStreamDevices(), |
214 content::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, | 226 content::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, |
215 scoped_ptr<content::MediaStreamUI>().Pass()); | 227 scoped_ptr<content::MediaStreamUI>().Pass()); |
216 return; | 228 return; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 DVLOG(0) << "File Chooser result: mode = " << mode | 292 DVLOG(0) << "File Chooser result: mode = " << mode |
281 << ", file paths = " << JoinString(file_path_str, ":"); | 293 << ", file paths = " << JoinString(file_path_str, ":"); |
282 rvh->FilesSelectedInChooser(files, mode); | 294 rvh->FilesSelectedInChooser(files, mode); |
283 } | 295 } |
284 | 296 |
285 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 297 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
286 return RegisterNativesImpl(env); | 298 return RegisterNativesImpl(env); |
287 } | 299 } |
288 | 300 |
289 } // namespace android_webview | 301 } // namespace android_webview |
OLD | NEW |