OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
17 #include "content/browser/android/interstitial_page_delegate_android.h" | 17 #include "content/browser/android/interstitial_page_delegate_android.h" |
18 #include "content/browser/android/load_url_params.h" | 18 #include "content/browser/android/load_url_params.h" |
19 #include "content/browser/android/media_player_manager_impl.h" | 19 #include "content/browser/android/media_player_manager_impl.h" |
20 #include "content/browser/android/sync_input_event_filter.h" | |
21 #include "content/browser/android/touch_point.h" | 20 #include "content/browser/android/touch_point.h" |
22 #include "content/browser/renderer_host/compositor_impl_android.h" | 21 #include "content/browser/renderer_host/compositor_impl_android.h" |
23 #include "content/browser/renderer_host/java/java_bound_object.h" | 22 #include "content/browser/renderer_host/java/java_bound_object.h" |
24 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager
.h" | 23 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager
.h" |
25 #include "content/browser/renderer_host/render_view_host_impl.h" | 24 #include "content/browser/renderer_host/render_view_host_impl.h" |
26 #include "content/browser/renderer_host/render_widget_host_impl.h" | 25 #include "content/browser/renderer_host/render_widget_host_impl.h" |
27 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 26 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
28 #include "content/browser/ssl/ssl_host_state.h" | 27 #include "content/browser/ssl/ssl_host_state.h" |
29 #include "content/browser/web_contents/interstitial_page_impl.h" | 28 #include "content/browser/web_contents/interstitial_page_impl.h" |
30 #include "content/browser/web_contents/navigation_controller_impl.h" | 29 #include "content/browser/web_contents/navigation_controller_impl.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 | 660 |
662 float ContentViewCoreImpl::GetOverdrawBottomHeightDip() const { | 661 float ContentViewCoreImpl::GetOverdrawBottomHeightDip() const { |
663 JNIEnv* env = AttachCurrentThread(); | 662 JNIEnv* env = AttachCurrentThread(); |
664 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 663 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
665 if (j_obj.is_null()) | 664 if (j_obj.is_null()) |
666 return 0.f; | 665 return 0.f; |
667 return Java_ContentViewCore_getOverdrawBottomHeightPix(env, j_obj.obj()) | 666 return Java_ContentViewCore_getOverdrawBottomHeightPix(env, j_obj.obj()) |
668 / GetDpiScale(); | 667 / GetDpiScale(); |
669 } | 668 } |
670 | 669 |
671 InputEventAckState ContentViewCoreImpl::FilterInputEvent( | |
672 const WebKit::WebInputEvent& input_event) { | |
673 if (!input_event_filter_) | |
674 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | |
675 | |
676 return input_event_filter_->HandleInputEvent(input_event); | |
677 } | |
678 | |
679 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { | 670 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { |
680 root_layer_->AddChild(layer); | 671 root_layer_->AddChild(layer); |
681 } | 672 } |
682 | 673 |
683 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { | 674 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { |
684 layer->RemoveFromParent(); | 675 layer->RemoveFromParent(); |
685 } | 676 } |
686 | 677 |
687 void ContentViewCoreImpl::LoadUrl( | 678 void ContentViewCoreImpl::LoadUrl( |
688 NavigationController::LoadURLParams& params) { | 679 NavigationController::LoadURLParams& params) { |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1552 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1562 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1553 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1563 return reinterpret_cast<jint>(view); | 1554 return reinterpret_cast<jint>(view); |
1564 } | 1555 } |
1565 | 1556 |
1566 bool RegisterContentViewCore(JNIEnv* env) { | 1557 bool RegisterContentViewCore(JNIEnv* env) { |
1567 return RegisterNativesImpl(env); | 1558 return RegisterNativesImpl(env); |
1568 } | 1559 } |
1569 | 1560 |
1570 } // namespace content | 1561 } // namespace content |
OLD | NEW |