Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 422 const gfx::SizeF& viewport_size, | 422 const gfx::SizeF& viewport_size, |
| 423 const gfx::Vector2dF& controls_offset, | 423 const gfx::Vector2dF& controls_offset, |
| 424 const gfx::Vector2dF& content_offset, | 424 const gfx::Vector2dF& content_offset, |
| 425 bool is_mobile_optimized_hint, | 425 bool is_mobile_optimized_hint, |
| 426 const gfx::SelectionBound& selection_start) { | 426 const gfx::SelectionBound& selection_start) { |
| 427 JNIEnv* env = AttachCurrentThread(); | 427 JNIEnv* env = AttachCurrentThread(); |
| 428 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 428 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 429 if (obj.is_null() || !view_.GetWindowAndroid()) | 429 if (obj.is_null() || !view_.GetWindowAndroid()) |
| 430 return; | 430 return; |
| 431 | 431 |
| 432 view_.GetWindowAndroid()->set_content_offset( | 432 view_.set_content_offset(gfx::ScaleVector2d(content_offset, dpi_scale_)); |
|
no sievers
2016/08/05 18:22:44
Actually with your change this can now be done in
Jinsuk Kim
2016/12/22 12:35:48
Done. BTW I'm not clear about what to do with the
boliu
2016/12/22 21:22:38
Hmm, debatable.
Ideally, the offset should be on
| |
| 433 gfx::ScaleVector2d(content_offset, dpi_scale_)); | |
| 434 | 433 |
| 435 page_scale_ = page_scale_factor; | 434 page_scale_ = page_scale_factor; |
| 436 | 435 |
| 437 // The CursorAnchorInfo API in Android only supports zero width selection | 436 // The CursorAnchorInfo API in Android only supports zero width selection |
| 438 // bounds. | 437 // bounds. |
| 439 const jboolean has_insertion_marker = | 438 const jboolean has_insertion_marker = |
| 440 selection_start.type() == gfx::SelectionBound::CENTER; | 439 selection_start.type() == gfx::SelectionBound::CENTER; |
| 441 const jboolean is_insertion_marker_visible = selection_start.visible(); | 440 const jboolean is_insertion_marker_visible = selection_start.visible(); |
| 442 const jfloat insertion_marker_horizontal = | 441 const jfloat insertion_marker_horizontal = |
| 443 has_insertion_marker ? selection_start.edge_top().x() : 0.0f; | 442 has_insertion_marker ? selection_start.edge_top().x() : 0.0f; |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1638 return ScopedJavaLocalRef<jobject>(); | 1637 return ScopedJavaLocalRef<jobject>(); |
| 1639 | 1638 |
| 1640 return view->GetJavaObject(); | 1639 return view->GetJavaObject(); |
| 1641 } | 1640 } |
| 1642 | 1641 |
| 1643 bool RegisterContentViewCore(JNIEnv* env) { | 1642 bool RegisterContentViewCore(JNIEnv* env) { |
| 1644 return RegisterNativesImpl(env); | 1643 return RegisterNativesImpl(env); |
| 1645 } | 1644 } |
| 1646 | 1645 |
| 1647 } // namespace content | 1646 } // namespace content |
| OLD | NEW |