| 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" |
| 11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/utf_string_conversions.h" | |
| 19 #include "base/values.h" | 18 #include "base/values.h" |
| 20 #include "cc/layers/layer.h" | 19 #include "cc/layers/layer.h" |
| 21 #include "cc/layers/solid_color_layer.h" | 20 #include "cc/layers/solid_color_layer.h" |
| 22 #include "cc/output/begin_frame_args.h" | 21 #include "cc/output/begin_frame_args.h" |
| 23 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 22 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
| 24 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 23 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 25 #include "content/browser/android/gesture_event_type.h" | 24 #include "content/browser/android/gesture_event_type.h" |
| 26 #include "content/browser/android/interstitial_page_delegate_android.h" | 25 #include "content/browser/android/interstitial_page_delegate_android.h" |
| 27 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" | 26 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" |
| 28 #include "content/browser/android/load_url_params.h" | 27 #include "content/browser/android/load_url_params.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 env, obj, scroll_offset.x(), scroll_offset.y(), page_scale_factor, | 435 env, obj, scroll_offset.x(), scroll_offset.y(), page_scale_factor, |
| 437 page_scale_factor_limits.x(), page_scale_factor_limits.y(), | 436 page_scale_factor_limits.x(), page_scale_factor_limits.y(), |
| 438 content_size.width(), content_size.height(), viewport_size.width(), | 437 content_size.width(), content_size.height(), viewport_size.width(), |
| 439 viewport_size.height(), top_controls_height, top_controls_shown_ratio, | 438 viewport_size.height(), top_controls_height, top_controls_shown_ratio, |
| 440 bottom_controls_height, bottom_controls_shown_ratio, | 439 bottom_controls_height, bottom_controls_shown_ratio, |
| 441 is_mobile_optimized_hint, has_insertion_marker, | 440 is_mobile_optimized_hint, has_insertion_marker, |
| 442 is_insertion_marker_visible, insertion_marker_horizontal, | 441 is_insertion_marker_visible, insertion_marker_horizontal, |
| 443 insertion_marker_top, insertion_marker_bottom); | 442 insertion_marker_top, insertion_marker_bottom); |
| 444 } | 443 } |
| 445 | 444 |
| 446 void ContentViewCoreImpl::SetTitle(const base::string16& title) { | |
| 447 JNIEnv* env = AttachCurrentThread(); | |
| 448 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
| 449 if (obj.is_null()) | |
| 450 return; | |
| 451 ScopedJavaLocalRef<jstring> jtitle = | |
| 452 ConvertUTF8ToJavaString(env, base::UTF16ToUTF8(title)); | |
| 453 Java_ContentViewCore_setTitle(env, obj, jtitle); | |
| 454 } | |
| 455 | |
| 456 void ContentViewCoreImpl::OnBackgroundColorChanged(SkColor color) { | 445 void ContentViewCoreImpl::OnBackgroundColorChanged(SkColor color) { |
| 457 JNIEnv* env = AttachCurrentThread(); | 446 JNIEnv* env = AttachCurrentThread(); |
| 458 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 447 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 459 if (obj.is_null()) | 448 if (obj.is_null()) |
| 460 return; | 449 return; |
| 461 Java_ContentViewCore_onBackgroundColorChanged(env, obj, color); | 450 Java_ContentViewCore_onBackgroundColorChanged(env, obj, color); |
| 462 } | 451 } |
| 463 | 452 |
| 464 void ContentViewCoreImpl::ShowSelectPopupMenu( | 453 void ContentViewCoreImpl::ShowSelectPopupMenu( |
| 465 RenderFrameHost* frame, | 454 RenderFrameHost* frame, |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 return ScopedJavaLocalRef<jobject>(); | 1596 return ScopedJavaLocalRef<jobject>(); |
| 1608 | 1597 |
| 1609 return view->GetJavaObject(); | 1598 return view->GetJavaObject(); |
| 1610 } | 1599 } |
| 1611 | 1600 |
| 1612 bool RegisterContentViewCore(JNIEnv* env) { | 1601 bool RegisterContentViewCore(JNIEnv* env) { |
| 1613 return RegisterNativesImpl(env); | 1602 return RegisterNativesImpl(env); |
| 1614 } | 1603 } |
| 1615 | 1604 |
| 1616 } // namespace content | 1605 } // namespace content |
| OLD | NEW |