| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 JNIEnv* env = base::android::AttachCurrentThread(); | 63 JNIEnv* env = base::android::AttachCurrentThread(); |
| 64 std::string json; | 64 std::string json; |
| 65 base::JSONWriter::Write(*result, &json); | 65 base::JSONWriter::Write(*result, &json); |
| 66 ScopedJavaLocalRef<jstring> j_json = ConvertUTF8ToJavaString(env, json); | 66 ScopedJavaLocalRef<jstring> j_json = ConvertUTF8ToJavaString(env, json); |
| 67 Java_WebContentsImpl_onEvaluateJavaScriptResult( | 67 Java_WebContentsImpl_onEvaluateJavaScriptResult( |
| 68 env, j_json.obj(), callback.obj()); | 68 env, j_json.obj(), callback.obj()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 struct AccessibilitySnapshotParams { | 71 struct AccessibilitySnapshotParams { |
| 72 AccessibilitySnapshotParams(float scale, | 72 AccessibilitySnapshotParams(float scale, |
| 73 float horizontal_scroll, | 73 float vertical_offset, |
| 74 float vertical_offset) | 74 float horizontal_scroll) |
| 75 : scale_factor(scale), | 75 : scale_factor(scale), |
| 76 y_offset(vertical_offset), |
| 76 x_scroll(horizontal_scroll), | 77 x_scroll(horizontal_scroll), |
| 77 y_offset(vertical_offset), | |
| 78 has_tree_data(false), | 78 has_tree_data(false), |
| 79 should_select_leaf_nodes(false) {} | 79 should_select_leaf_nodes(false) {} |
| 80 | 80 |
| 81 float scale_factor; | 81 float scale_factor; |
| 82 float y_offset; |
| 82 float x_scroll; | 83 float x_scroll; |
| 83 float y_offset; | |
| 84 bool has_tree_data; | 84 bool has_tree_data; |
| 85 // The current text selection within this tree, if any, expressed as the | 85 // The current text selection within this tree, if any, expressed as the |
| 86 // node ID and character offset of the anchor (selection start) and focus | 86 // node ID and character offset of the anchor (selection start) and focus |
| 87 // (selection end). | 87 // (selection end). |
| 88 int32_t sel_anchor_object_id; | 88 int32_t sel_anchor_object_id; |
| 89 int32_t sel_anchor_offset; | 89 int32_t sel_anchor_offset; |
| 90 int32_t sel_focus_object_id; | 90 int32_t sel_focus_object_id; |
| 91 int32_t sel_focus_offset; | 91 int32_t sel_focus_offset; |
| 92 // if the flag is true, mark the leaf node as selected. | 92 // if the flag is true, mark the leaf node as selected. |
| 93 bool should_select_leaf_nodes; | 93 bool should_select_leaf_nodes; |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 if (response == READBACK_SUCCESS) | 692 if (response == READBACK_SUCCESS) |
| 693 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); | 693 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); |
| 694 Java_WebContentsImpl_onGetContentBitmapFinished(env, | 694 Java_WebContentsImpl_onGetContentBitmapFinished(env, |
| 695 obj->obj(), | 695 obj->obj(), |
| 696 callback->obj(), | 696 callback->obj(), |
| 697 java_bitmap.obj(), | 697 java_bitmap.obj(), |
| 698 response); | 698 response); |
| 699 } | 699 } |
| 700 | 700 |
| 701 } // namespace content | 701 } // namespace content |
| OLD | NEW |