| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 int bgcolor = 0; | 102 int bgcolor = 0; |
| 103 int text_style = 0; | 103 int text_style = 0; |
| 104 | 104 |
| 105 if (node->HasFloatAttribute(ui::AX_ATTR_FONT_SIZE)) { | 105 if (node->HasFloatAttribute(ui::AX_ATTR_FONT_SIZE)) { |
| 106 color = node->GetIntAttribute(ui::AX_ATTR_COLOR); | 106 color = node->GetIntAttribute(ui::AX_ATTR_COLOR); |
| 107 bgcolor = node->GetIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR); | 107 bgcolor = node->GetIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR); |
| 108 size = node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE); | 108 size = node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE); |
| 109 text_style = node->GetIntAttribute(ui::AX_ATTR_TEXT_STYLE); | 109 text_style = node->GetIntAttribute(ui::AX_ATTR_TEXT_STYLE); |
| 110 } | 110 } |
| 111 | 111 |
| 112 const gfx::Rect& absolute_rect = node->GetLocalBoundsRect(); | 112 const gfx::Rect& absolute_rect = node->GetPageBoundsRect(); |
| 113 gfx::Rect parent_relative_rect = absolute_rect; | 113 gfx::Rect parent_relative_rect = absolute_rect; |
| 114 bool is_root = node->GetParent() == nullptr; | 114 bool is_root = node->GetParent() == nullptr; |
| 115 if (!is_root) { | 115 if (!is_root) { |
| 116 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); | 116 parent_relative_rect.Offset(-parent_rect.OffsetFromOrigin()); |
| 117 } | 117 } |
| 118 ScopedJavaLocalRef<jobject> j_node = | 118 ScopedJavaLocalRef<jobject> j_node = |
| 119 Java_WebContentsImpl_createAccessibilitySnapshotNode( | 119 Java_WebContentsImpl_createAccessibilitySnapshotNode( |
| 120 env, parent_relative_rect.x(), parent_relative_rect.y(), | 120 env, parent_relative_rect.x(), parent_relative_rect.y(), |
| 121 absolute_rect.width(), absolute_rect.height(), is_root, j_text.obj(), | 121 absolute_rect.width(), absolute_rect.height(), is_root, j_text.obj(), |
| 122 color, bgcolor, size, text_style, j_class.obj()); | 122 color, bgcolor, size, text_style, j_class.obj()); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 } | 727 } |
| 728 for (const gfx::Size& size : sizes) { | 728 for (const gfx::Size& size : sizes) { |
| 729 Java_WebContentsImpl_createSizeAndAddToList( | 729 Java_WebContentsImpl_createSizeAndAddToList( |
| 730 env, jsizes.obj(), size.width(), size.height()); | 730 env, jsizes.obj(), size.width(), size.height()); |
| 731 } | 731 } |
| 732 Java_WebContentsImpl_onDownloadImageFinished( | 732 Java_WebContentsImpl_onDownloadImageFinished( |
| 733 env, obj->obj(), callback->obj(), id, | 733 env, obj->obj(), callback->obj(), id, |
| 734 http_status_code, jurl.obj(), jbitmaps.obj(), jsizes.obj()); | 734 http_status_code, jurl.obj(), jbitmaps.obj(), jsizes.obj()); |
| 735 } | 735 } |
| 736 } // namespace content | 736 } // namespace content |
| OLD | NEW |