| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 env, android_node->GetText()).obj()); | 169 env, android_node->GetText()).obj()); |
| 170 break; | 170 break; |
| 171 } | 171 } |
| 172 case ui::AX_EVENT_TEXT_SELECTION_CHANGED: | 172 case ui::AX_EVENT_TEXT_SELECTION_CHANGED: |
| 173 Java_BrowserAccessibilityManager_handleTextSelectionChanged( | 173 Java_BrowserAccessibilityManager_handleTextSelectionChanged( |
| 174 env, obj.obj(), node->GetId()); | 174 env, obj.obj(), node->GetId()); |
| 175 break; | 175 break; |
| 176 case ui::AX_EVENT_CHILDREN_CHANGED: | 176 case ui::AX_EVENT_CHILDREN_CHANGED: |
| 177 case ui::AX_EVENT_TEXT_CHANGED: | 177 case ui::AX_EVENT_TEXT_CHANGED: |
| 178 case ui::AX_EVENT_VALUE_CHANGED: | 178 case ui::AX_EVENT_VALUE_CHANGED: |
| 179 if (node->IsEditableText()) { | 179 if (node->IsEditableText() && GetFocus(GetRoot()) == node) { |
| 180 Java_BrowserAccessibilityManager_handleEditableTextChanged( | 180 Java_BrowserAccessibilityManager_handleEditableTextChanged( |
| 181 env, obj.obj(), node->GetId()); | 181 env, obj.obj(), node->GetId()); |
| 182 } else if (android_node->IsSlider()) { | 182 } else if (android_node->IsSlider()) { |
| 183 Java_BrowserAccessibilityManager_handleSliderChanged( | 183 Java_BrowserAccessibilityManager_handleSliderChanged( |
| 184 env, obj.obj(), node->GetId()); | 184 env, obj.obj(), node->GetId()); |
| 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. |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { | 741 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { |
| 742 // The Java layer handles the root scroll offset. | 742 // The Java layer handles the root scroll offset. |
| 743 return false; | 743 return false; |
| 744 } | 744 } |
| 745 | 745 |
| 746 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 746 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
| 747 return RegisterNativesImpl(env); | 747 return RegisterNativesImpl(env); |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace content | 750 } // namespace content |
| OLD | NEW |