OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser_accessibility_manager_android.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 break; | 186 break; |
187 default: | 187 default: |
188 // There are some notifications that aren't meaningful on Android. | 188 // There are some notifications that aren't meaningful on Android. |
189 // It's okay to skip them. | 189 // It's okay to skip them. |
190 break; | 190 break; |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 jint BrowserAccessibilityManagerAndroid::GetRootId(JNIEnv* env, jobject obj) { | 194 jint BrowserAccessibilityManagerAndroid::GetRootId(JNIEnv* env, jobject obj) { |
195 return static_cast<jint>(GetRoot()->GetId()); | 195 if (GetRoot()) |
| 196 return static_cast<jint>(GetRoot()->GetId()); |
| 197 else |
| 198 return -1; |
196 } | 199 } |
197 | 200 |
198 jboolean BrowserAccessibilityManagerAndroid::IsNodeValid( | 201 jboolean BrowserAccessibilityManagerAndroid::IsNodeValid( |
199 JNIEnv* env, jobject obj, jint id) { | 202 JNIEnv* env, jobject obj, jint id) { |
200 return GetFromID(id) != NULL; | 203 return GetFromID(id) != NULL; |
201 } | 204 } |
202 | 205 |
203 void BrowserAccessibilityManagerAndroid::HitTest( | 206 void BrowserAccessibilityManagerAndroid::HitTest( |
204 JNIEnv* env, jobject obj, jint x, jint y) { | 207 JNIEnv* env, jobject obj, jint x, jint y) { |
205 if (delegate()) | 208 if (delegate()) |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { | 780 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { |
778 // The Java layer handles the root scroll offset. | 781 // The Java layer handles the root scroll offset. |
779 return false; | 782 return false; |
780 } | 783 } |
781 | 784 |
782 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 785 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
783 return RegisterNativesImpl(env); | 786 return RegisterNativesImpl(env); |
784 } | 787 } |
785 | 788 |
786 } // namespace content | 789 } // namespace content |
OLD | NEW |