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

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

Issue 665513002: Fix Android hit testing in a totally static page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iframe_no_bam
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 void BrowserAccessibilityManagerAndroid::HandleHoverEvent( 410 void BrowserAccessibilityManagerAndroid::HandleHoverEvent(
411 BrowserAccessibility* node) { 411 BrowserAccessibility* node) {
412 JNIEnv* env = AttachCurrentThread(); 412 JNIEnv* env = AttachCurrentThread();
413 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 413 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
414 if (obj.is_null()) 414 if (obj.is_null())
415 return; 415 return;
416 416
417 BrowserAccessibilityAndroid* ancestor = 417 BrowserAccessibilityAndroid* ancestor =
418 static_cast<BrowserAccessibilityAndroid*>(node->GetParent()); 418 static_cast<BrowserAccessibilityAndroid*>(node->GetParent());
419 while (ancestor) { 419 while (ancestor && ancestor != GetRoot()) {
aboxhall 2014/10/16 21:33:34 Would it be worthwhile pulling the result of GetRo
dmazzoni 2014/10/16 21:47:24 The compiler ought to be smart enough to do this.
420 if (ancestor->PlatformIsLeaf() || 420 if (ancestor->PlatformIsLeaf() ||
421 (ancestor->IsFocusable() && !ancestor->HasFocusableChild())) { 421 (ancestor->IsFocusable() && !ancestor->HasFocusableChild())) {
422 node = ancestor; 422 node = ancestor;
423 // Don't break - we want the highest ancestor that's focusable or a 423 // Don't break - we want the highest ancestor that's focusable or a
424 // leaf node. 424 // leaf node.
425 } 425 }
426 ancestor = static_cast<BrowserAccessibilityAndroid*>(ancestor->GetParent()); 426 ancestor = static_cast<BrowserAccessibilityAndroid*>(ancestor->GetParent());
427 } 427 }
428 428
429 Java_BrowserAccessibilityManager_handleHover( 429 Java_BrowserAccessibilityManager_handleHover(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { 500 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() {
501 // The Java layer handles the root scroll offset. 501 // The Java layer handles the root scroll offset.
502 return false; 502 return false;
503 } 503 }
504 504
505 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { 505 bool RegisterBrowserAccessibilityManager(JNIEnv* env) {
506 return RegisterNativesImpl(env); 506 return RegisterNativesImpl(env);
507 } 507 }
508 508
509 } // namespace content 509 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698