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

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

Issue 505423002: Re-focus node with Android accessibility focus when it moves (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_accessibility_focus_3b
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 gfx::Rect absolute_rect = node->GetLocalBoundsRect(); 241 gfx::Rect absolute_rect = node->GetLocalBoundsRect();
242 gfx::Rect parent_relative_rect = absolute_rect; 242 gfx::Rect parent_relative_rect = absolute_rect;
243 if (node->GetParent()) { 243 if (node->GetParent()) {
244 gfx::Rect parent_rect = node->GetParent()->GetLocalBoundsRect(); 244 gfx::Rect parent_rect = node->GetParent()->GetLocalBoundsRect();
245 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); 245 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin());
246 } 246 }
247 bool is_root = node->GetParent() == NULL; 247 bool is_root = node->GetParent() == NULL;
248 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoLocation( 248 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoLocation(
249 env, obj, info, 249 env, obj, info,
250 id,
250 absolute_rect.x(), absolute_rect.y(), 251 absolute_rect.x(), absolute_rect.y(),
251 parent_relative_rect.x(), parent_relative_rect.y(), 252 parent_relative_rect.x(), parent_relative_rect.y(),
252 absolute_rect.width(), absolute_rect.height(), 253 absolute_rect.width(), absolute_rect.height(),
253 is_root); 254 is_root);
254 255
255 // New KitKat APIs 256 // New KitKat APIs
256 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoKitKatAttributes( 257 Java_BrowserAccessibilityManager_setAccessibilityNodeInfoKitKatAttributes(
257 env, obj, info, 258 env, obj, info,
258 node->CanOpenPopup(), 259 node->CanOpenPopup(),
259 node->IsContentInvalid(), 260 node->IsContentInvalid(),
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { 495 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() {
495 // The Java layer handles the root scroll offset. 496 // The Java layer handles the root scroll offset.
496 return false; 497 return false;
497 } 498 }
498 499
499 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 500 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
500 return RegisterNativesImpl(env); 501 return RegisterNativesImpl(env);
501 } 502 }
502 503
503 } // namespace content 504 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698