| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 callback.Run(content::MediaStreamDevices(), | 238 callback.Run(content::MediaStreamDevices(), |
| 239 content::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, | 239 content::MEDIA_DEVICE_FAILED_DUE_TO_SHUTDOWN, |
| 240 std::unique_ptr<content::MediaStreamUI>()); | 240 std::unique_ptr<content::MediaStreamUI>()); |
| 241 return; | 241 return; |
| 242 } | 242 } |
| 243 aw_contents->GetPermissionRequestHandler()->SendRequest( | 243 aw_contents->GetPermissionRequestHandler()->SendRequest( |
| 244 std::unique_ptr<AwPermissionRequestDelegate>( | 244 std::unique_ptr<AwPermissionRequestDelegate>( |
| 245 new MediaAccessPermissionRequest(request, callback))); | 245 new MediaAccessPermissionRequest(request, callback))); |
| 246 } | 246 } |
| 247 | 247 |
| 248 ScopedJavaLocalRef<jobject> |
| 249 AwWebContentsDelegate::GetContentVideoViewEmbedder() { |
| 250 JNIEnv* env = base::android::AttachCurrentThread(); |
| 251 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 252 if (obj.is_null()) |
| 253 return ScopedJavaLocalRef<jobject>(); |
| 254 |
| 255 return Java_AwWebContentsDelegate_getContentVideoViewEmbedder(env, obj); |
| 256 } |
| 257 |
| 258 bool AwWebContentsDelegate::ShouldBlockMediaRequest(const GURL& url) { |
| 259 JNIEnv* env = base::android::AttachCurrentThread(); |
| 260 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 261 if (obj.is_null()) |
| 262 return false; |
| 263 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); |
| 264 return Java_AwWebContentsDelegate_shouldBlockMediaRequest(env, obj, j_url); |
| 265 } |
| 266 |
| 248 void AwWebContentsDelegate::EnterFullscreenModeForTab( | 267 void AwWebContentsDelegate::EnterFullscreenModeForTab( |
| 249 content::WebContents* web_contents, const GURL& origin) { | 268 content::WebContents* web_contents, const GURL& origin) { |
| 250 WebContentsDelegateAndroid::EnterFullscreenModeForTab(web_contents, origin); | 269 WebContentsDelegateAndroid::EnterFullscreenModeForTab(web_contents, origin); |
| 251 is_fullscreen_ = true; | 270 is_fullscreen_ = true; |
| 252 web_contents->GetRenderViewHost()->GetWidget()->WasResized(); | 271 web_contents->GetRenderViewHost()->GetWidget()->WasResized(); |
| 253 } | 272 } |
| 254 | 273 |
| 255 void AwWebContentsDelegate::ExitFullscreenModeForTab( | 274 void AwWebContentsDelegate::ExitFullscreenModeForTab( |
| 256 content::WebContents* web_contents) { | 275 content::WebContents* web_contents) { |
| 257 WebContentsDelegateAndroid::ExitFullscreenModeForTab(web_contents); | 276 WebContentsDelegateAndroid::ExitFullscreenModeForTab(web_contents); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 DVLOG(0) << "File Chooser result: mode = " << mode | 331 DVLOG(0) << "File Chooser result: mode = " << mode |
| 313 << ", file paths = " << base::JoinString(file_path_str, ":"); | 332 << ", file paths = " << base::JoinString(file_path_str, ":"); |
| 314 rfh->FilesSelectedInChooser(files, mode); | 333 rfh->FilesSelectedInChooser(files, mode); |
| 315 } | 334 } |
| 316 | 335 |
| 317 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 336 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 318 return RegisterNativesImpl(env); | 337 return RegisterNativesImpl(env); |
| 319 } | 338 } |
| 320 | 339 |
| 321 } // namespace android_webview | 340 } // namespace android_webview |
| OLD | NEW |