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/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // transformations to get the actual pixel size. | 123 // transformations to get the actual pixel size. |
124 gfx::RectF text_size_rect( | 124 gfx::RectF text_size_rect( |
125 0, 0, 1, node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE)); | 125 0, 0, 1, node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE)); |
126 gfx::Rect scaled_text_size_rect = node->RelativeToAbsoluteBounds( | 126 gfx::Rect scaled_text_size_rect = node->RelativeToAbsoluteBounds( |
127 text_size_rect, false); | 127 text_size_rect, false); |
128 size = scaled_text_size_rect.height(); | 128 size = scaled_text_size_rect.height(); |
129 } | 129 } |
130 | 130 |
131 const gfx::Rect& absolute_rect = node->GetPageBoundsRect(); | 131 const gfx::Rect& absolute_rect = node->GetPageBoundsRect(); |
132 gfx::Rect parent_relative_rect = absolute_rect; | 132 gfx::Rect parent_relative_rect = absolute_rect; |
133 bool is_root = node->GetParent() == nullptr; | 133 bool is_root = node->PlatformGetParent() == nullptr; |
134 if (!is_root) { | 134 if (!is_root) { |
135 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); | 135 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); |
136 } | 136 } |
137 ScopedJavaLocalRef<jobject> j_node = | 137 ScopedJavaLocalRef<jobject> j_node = |
138 Java_WebContentsImpl_createAccessibilitySnapshotNode( | 138 Java_WebContentsImpl_createAccessibilitySnapshotNode( |
139 env, parent_relative_rect.x(), parent_relative_rect.y(), | 139 env, parent_relative_rect.x(), parent_relative_rect.y(), |
140 absolute_rect.width(), absolute_rect.height(), is_root, j_text, color, | 140 absolute_rect.width(), absolute_rect.height(), is_root, j_text, color, |
141 bgcolor, size, text_style, j_class); | 141 bgcolor, size, text_style, j_class); |
142 | 142 |
143 if (params->has_tree_data && node->PlatformIsLeaf()) { | 143 if (params->has_tree_data && node->PlatformIsLeaf()) { |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 772 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
773 } | 773 } |
774 | 774 |
775 void WebContentsAndroid::SetMediaSession( | 775 void WebContentsAndroid::SetMediaSession( |
776 const ScopedJavaLocalRef<jobject>& j_media_session) { | 776 const ScopedJavaLocalRef<jobject>& j_media_session) { |
777 JNIEnv* env = base::android::AttachCurrentThread(); | 777 JNIEnv* env = base::android::AttachCurrentThread(); |
778 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 778 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
779 } | 779 } |
780 | 780 |
781 } // namespace content | 781 } // namespace content |
OLD | NEW |