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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 BrowserAccessibilityManager::ToBrowserAccessibilityManagerAndroid() { | 64 BrowserAccessibilityManager::ToBrowserAccessibilityManagerAndroid() { |
65 return static_cast<BrowserAccessibilityManagerAndroid*>(this); | 65 return static_cast<BrowserAccessibilityManagerAndroid*>(this); |
66 } | 66 } |
67 | 67 |
68 BrowserAccessibilityManagerAndroid::BrowserAccessibilityManagerAndroid( | 68 BrowserAccessibilityManagerAndroid::BrowserAccessibilityManagerAndroid( |
69 ScopedJavaLocalRef<jobject> content_view_core, | 69 ScopedJavaLocalRef<jobject> content_view_core, |
70 const ui::AXTreeUpdate& initial_tree, | 70 const ui::AXTreeUpdate& initial_tree, |
71 BrowserAccessibilityDelegate* delegate, | 71 BrowserAccessibilityDelegate* delegate, |
72 BrowserAccessibilityFactory* factory) | 72 BrowserAccessibilityFactory* factory) |
73 : BrowserAccessibilityManager(delegate, factory) { | 73 : BrowserAccessibilityManager(delegate, factory) { |
| 74 Initialize(initial_tree); |
74 SetContentViewCore(content_view_core); | 75 SetContentViewCore(content_view_core); |
75 Initialize(initial_tree); | |
76 } | 76 } |
77 | 77 |
78 BrowserAccessibilityManagerAndroid::~BrowserAccessibilityManagerAndroid() { | 78 BrowserAccessibilityManagerAndroid::~BrowserAccessibilityManagerAndroid() { |
79 JNIEnv* env = AttachCurrentThread(); | 79 JNIEnv* env = AttachCurrentThread(); |
80 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 80 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
81 if (obj.is_null()) | 81 if (obj.is_null()) |
82 return; | 82 return; |
83 | 83 |
84 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(env, obj.obj()); | 84 Java_BrowserAccessibilityManager_onNativeObjectDestroyed(env, obj.obj()); |
85 } | 85 } |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { | 745 BrowserAccessibilityManagerAndroid::UseRootScrollOffsetsWhenComputingBounds() { |
746 // The Java layer handles the root scroll offset. | 746 // The Java layer handles the root scroll offset. |
747 return false; | 747 return false; |
748 } | 748 } |
749 | 749 |
750 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { | 750 bool RegisterBrowserAccessibilityManager(JNIEnv* env) { |
751 return RegisterNativesImpl(env); | 751 return RegisterNativesImpl(env); |
752 } | 752 } |
753 | 753 |
754 } // namespace content | 754 } // namespace content |
OLD | NEW |