Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 1882283002: Fix the scroll and zoom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698