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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager_android.cc

Issue 2420413006: Android accessibility: fix word/character navigation in unfocused text fields (Closed)
Patch Set: Created 4 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 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 JNIEnv* env, 356 JNIEnv* env,
357 const JavaParamRef<jobject>& obj, 357 const JavaParamRef<jobject>& obj,
358 jint id) { 358 jint id) {
359 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); 359 BrowserAccessibilityAndroid* node = GetFromUniqueID(id);
360 if (!node) 360 if (!node)
361 return false; 361 return false;
362 362
363 return node->IsEditableText(); 363 return node->IsEditableText();
364 } 364 }
365 365
366 jboolean BrowserAccessibilityManagerAndroid::IsFocused(
367 JNIEnv* env,
368 const JavaParamRef<jobject>& obj,
369 jint id) {
370 BrowserAccessibilityAndroid* node = GetFromUniqueID(id);
371 if (!node)
372 return false;
373
374 return node->IsFocused();
375 }
376
366 jint BrowserAccessibilityManagerAndroid::GetEditableTextSelectionStart( 377 jint BrowserAccessibilityManagerAndroid::GetEditableTextSelectionStart(
367 JNIEnv* env, 378 JNIEnv* env,
368 const JavaParamRef<jobject>& obj, 379 const JavaParamRef<jobject>& obj,
369 jint id) { 380 jint id) {
370 BrowserAccessibilityAndroid* node = GetFromUniqueID(id); 381 BrowserAccessibilityAndroid* node = GetFromUniqueID(id);
371 if (!node) 382 if (!node)
372 return false; 383 return false;
373 384
374 return node->GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START); 385 return node->GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START);
375 } 386 }
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 988
978 JNIEnv* env = AttachCurrentThread(); 989 JNIEnv* env = AttachCurrentThread();
979 return root_manager->java_ref().get(env); 990 return root_manager->java_ref().get(env);
980 } 991 }
981 992
982 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 993 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
983 return RegisterNativesImpl(env); 994 return RegisterNativesImpl(env);
984 } 995 }
985 996
986 } // namespace content 997 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698