Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 618013003: Support fullscreen for non-video elements in the WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactorFullscreenNonMedia
Patch Set: Added comment and android ifdefs Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 676
677 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() { 677 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() {
678 JNIEnv* env = AttachCurrentThread(); 678 JNIEnv* env = AttachCurrentThread();
679 679
680 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 680 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
681 if (obj.is_null()) 681 if (obj.is_null())
682 return ScopedJavaLocalRef<jobject>(); 682 return ScopedJavaLocalRef<jobject>();
683 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj()); 683 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj());
684 } 684 }
685 685
686 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContentVideoViewClient() {
687 JNIEnv* env = AttachCurrentThread();
688
689 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
690 if (obj.is_null())
691 return ScopedJavaLocalRef<jobject>();
692
693 return Java_ContentViewCore_getContentVideoViewClient(env, obj.obj());
694 }
695
696 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() {
697 JNIEnv* env = AttachCurrentThread();
698
699 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
700 if (obj.is_null())
701 return ScopedJavaLocalRef<jobject>();
702
703 return Java_ContentViewCore_getContext(env, obj.obj());
704 }
705
706 bool ContentViewCoreImpl::ShouldBlockMediaRequest(const GURL& url) { 686 bool ContentViewCoreImpl::ShouldBlockMediaRequest(const GURL& url) {
707 JNIEnv* env = AttachCurrentThread(); 687 JNIEnv* env = AttachCurrentThread();
708 688
709 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 689 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
710 if (obj.is_null()) 690 if (obj.is_null())
711 return true; 691 return true;
712 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); 692 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec());
713 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), 693 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(),
714 j_url.obj()); 694 j_url.obj());
715 } 695 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 1201
1222 bool ContentViewCoreImpl::IsFullscreenRequiredForOrientationLock() const { 1202 bool ContentViewCoreImpl::IsFullscreenRequiredForOrientationLock() const {
1223 JNIEnv* env = AttachCurrentThread(); 1203 JNIEnv* env = AttachCurrentThread();
1224 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1204 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1225 if (obj.is_null()) 1205 if (obj.is_null())
1226 return true; 1206 return true;
1227 return Java_ContentViewCore_isFullscreenRequiredForOrientationLock(env, 1207 return Java_ContentViewCore_isFullscreenRequiredForOrientationLock(env,
1228 obj.obj()); 1208 obj.obj());
1229 } 1209 }
1230 1210
1211 void ContentViewCoreImpl::OnDidEnterFullscreen() {
1212 JNIEnv* env = AttachCurrentThread();
1213 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1214 if (obj.is_null())
1215 return;
1216 Java_ContentViewCore_onDidEnterFullscreen(env, obj.obj());
1217 }
1218
1219 void ContentViewCoreImpl::OnDidExitFullscreen() {
1220 JNIEnv* env = AttachCurrentThread();
1221 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1222 if (obj.is_null())
1223 return;
1224 Java_ContentViewCore_onDidExitFullscreen(env, obj.obj());
1225 }
1226
1231 void ContentViewCoreImpl::SetAccessibilityEnabledInternal(bool enabled) { 1227 void ContentViewCoreImpl::SetAccessibilityEnabledInternal(bool enabled) {
1232 accessibility_enabled_ = enabled; 1228 accessibility_enabled_ = enabled;
1233 BrowserAccessibilityStateImpl* accessibility_state = 1229 BrowserAccessibilityStateImpl* accessibility_state =
1234 BrowserAccessibilityStateImpl::GetInstance(); 1230 BrowserAccessibilityStateImpl::GetInstance();
1235 if (enabled) { 1231 if (enabled) {
1236 // This enables accessibility globally unless it was explicitly disallowed 1232 // This enables accessibility globally unless it was explicitly disallowed
1237 // by a command-line flag. 1233 // by a command-line flag.
1238 accessibility_state->OnScreenReaderDetected(); 1234 accessibility_state->OnScreenReaderDetected();
1239 // If it was actually enabled globally, enable it for this RenderWidget now. 1235 // If it was actually enabled globally, enable it for this RenderWidget now.
1240 if (accessibility_state->IsAccessibleBrowser() && web_contents_) 1236 if (accessibility_state->IsAccessibleBrowser() && web_contents_)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), 1334 reinterpret_cast<ui::WindowAndroid*>(window_android),
1339 retained_objects_set); 1335 retained_objects_set);
1340 return reinterpret_cast<intptr_t>(view); 1336 return reinterpret_cast<intptr_t>(view);
1341 } 1337 }
1342 1338
1343 bool RegisterContentViewCore(JNIEnv* env) { 1339 bool RegisterContentViewCore(JNIEnv* env) {
1344 return RegisterNativesImpl(env); 1340 return RegisterNativesImpl(env);
1345 } 1341 }
1346 1342
1347 } // namespace content 1343 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698