| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 const float top_controls_shown_ratio, | 415 const float top_controls_shown_ratio, |
| 416 const float bottom_controls_height, | 416 const float bottom_controls_height, |
| 417 const float bottom_controls_shown_ratio, | 417 const float bottom_controls_shown_ratio, |
| 418 bool is_mobile_optimized_hint, | 418 bool is_mobile_optimized_hint, |
| 419 const gfx::SelectionBound& selection_start) { | 419 const gfx::SelectionBound& selection_start) { |
| 420 JNIEnv* env = AttachCurrentThread(); | 420 JNIEnv* env = AttachCurrentThread(); |
| 421 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 421 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 422 if (obj.is_null() || !GetWindowAndroid()) | 422 if (obj.is_null() || !GetWindowAndroid()) |
| 423 return; | 423 return; |
| 424 | 424 |
| 425 GetWindowAndroid()->set_content_offset( | |
| 426 gfx::Vector2dF(0.0f, top_controls_height * top_controls_shown_ratio)); | |
| 427 | |
| 428 page_scale_ = page_scale_factor; | 425 page_scale_ = page_scale_factor; |
| 429 | 426 |
| 430 // The CursorAnchorInfo API in Android only supports zero width selection | 427 // The CursorAnchorInfo API in Android only supports zero width selection |
| 431 // bounds. | 428 // bounds. |
| 432 const jboolean has_insertion_marker = | 429 const jboolean has_insertion_marker = |
| 433 selection_start.type() == gfx::SelectionBound::CENTER; | 430 selection_start.type() == gfx::SelectionBound::CENTER; |
| 434 const jboolean is_insertion_marker_visible = selection_start.visible(); | 431 const jboolean is_insertion_marker_visible = selection_start.visible(); |
| 435 const jfloat insertion_marker_horizontal = | 432 const jfloat insertion_marker_horizontal = |
| 436 has_insertion_marker ? selection_start.edge_top().x() : 0.0f; | 433 has_insertion_marker ? selection_start.edge_top().x() : 0.0f; |
| 437 const jfloat insertion_marker_top = | 434 const jfloat insertion_marker_top = |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 return ScopedJavaLocalRef<jobject>(); | 1564 return ScopedJavaLocalRef<jobject>(); |
| 1568 | 1565 |
| 1569 return view->GetJavaObject(); | 1566 return view->GetJavaObject(); |
| 1570 } | 1567 } |
| 1571 | 1568 |
| 1572 bool RegisterContentViewCore(JNIEnv* env) { | 1569 bool RegisterContentViewCore(JNIEnv* env) { |
| 1573 return RegisterNativesImpl(env); | 1570 return RegisterNativesImpl(env); |
| 1574 } | 1571 } |
| 1575 | 1572 |
| 1576 } // namespace content | 1573 } // namespace content |
| OLD | NEW |