OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/accessibility/web_contents_accessibility_android.h" | 5 #include "content/browser/accessibility/web_contents_accessibility_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 BrowserAccessibilityAndroid* node = GetAXFromUniqueID(unique_id); | 1077 BrowserAccessibilityAndroid* node = GetAXFromUniqueID(unique_id); |
1078 if (!node) | 1078 if (!node) |
1079 return false; | 1079 return false; |
1080 | 1080 |
1081 return node->Scroll(direction); | 1081 return node->Scroll(direction); |
1082 } | 1082 } |
1083 | 1083 |
1084 BrowserAccessibilityAndroid* WebContentsAccessibilityAndroid::GetAXFromUniqueID( | 1084 BrowserAccessibilityAndroid* WebContentsAccessibilityAndroid::GetAXFromUniqueID( |
1085 int32_t unique_id) { | 1085 int32_t unique_id) { |
1086 return static_cast<BrowserAccessibilityAndroid*>( | 1086 return static_cast<BrowserAccessibilityAndroid*>( |
1087 BrowserAccessibility::GetFromUniqueID(unique_id)); | 1087 BrowserAccessibility::GetFromUniqueId(unique_id)); |
1088 } | 1088 } |
1089 | 1089 |
1090 void WebContentsAccessibilityAndroid::UpdateFrameInfo() { | 1090 void WebContentsAccessibilityAndroid::UpdateFrameInfo() { |
1091 if (frame_info_initialized_) | 1091 if (frame_info_initialized_) |
1092 return; | 1092 return; |
1093 | 1093 |
1094 JNIEnv* env = AttachCurrentThread(); | 1094 JNIEnv* env = AttachCurrentThread(); |
1095 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1095 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1096 if (obj.is_null()) | 1096 if (obj.is_null()) |
1097 return; | 1097 return; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 const JavaParamRef<jobject>& jweb_contents, | 1177 const JavaParamRef<jobject>& jweb_contents, |
1178 jboolean should_focus_on_page_load) { | 1178 jboolean should_focus_on_page_load) { |
1179 WebContents* web_contents = WebContents::FromJavaWebContents(jweb_contents); | 1179 WebContents* web_contents = WebContents::FromJavaWebContents(jweb_contents); |
1180 DCHECK(web_contents); | 1180 DCHECK(web_contents); |
1181 | 1181 |
1182 return reinterpret_cast<intptr_t>(new WebContentsAccessibilityAndroid( | 1182 return reinterpret_cast<intptr_t>(new WebContentsAccessibilityAndroid( |
1183 env, obj, web_contents, should_focus_on_page_load)); | 1183 env, obj, web_contents, should_focus_on_page_load)); |
1184 } | 1184 } |
1185 | 1185 |
1186 } // namespace content | 1186 } // namespace content |
OLD | NEW |