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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 680 |
682 float ContentViewCoreImpl::GetOverdrawBottomHeightDip() const { | 681 float ContentViewCoreImpl::GetOverdrawBottomHeightDip() const { |
683 JNIEnv* env = AttachCurrentThread(); | 682 JNIEnv* env = AttachCurrentThread(); |
684 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 683 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
685 if (j_obj.is_null()) | 684 if (j_obj.is_null()) |
686 return 0.f; | 685 return 0.f; |
687 return Java_ContentViewCore_getOverdrawBottomHeightPix(env, j_obj.obj()) | 686 return Java_ContentViewCore_getOverdrawBottomHeightPix(env, j_obj.obj()) |
688 / GetDpiScale(); | 687 / GetDpiScale(); |
689 } | 688 } |
690 | 689 |
691 InputEventAckState ContentViewCoreImpl::FilterInputEvent( | |
692 const WebKit::WebInputEvent& input_event) { | |
693 if (!input_event_filter_) | |
694 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | |
695 | |
696 return input_event_filter_->HandleInputEvent(input_event); | |
697 } | |
698 | |
699 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { | 690 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { |
700 root_layer_->AddChild(layer); | 691 root_layer_->AddChild(layer); |
701 } | 692 } |
702 | 693 |
703 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { | 694 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { |
704 layer->RemoveFromParent(); | 695 layer->RemoveFromParent(); |
705 } | 696 } |
706 | 697 |
707 void ContentViewCoreImpl::LoadUrl( | 698 void ContentViewCoreImpl::LoadUrl( |
708 NavigationController::LoadURLParams& params) { | 699 NavigationController::LoadURLParams& params) { |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1556 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1566 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1557 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1567 return reinterpret_cast<jint>(view); | 1558 return reinterpret_cast<jint>(view); |
1568 } | 1559 } |
1569 | 1560 |
1570 bool RegisterContentViewCore(JNIEnv* env) { | 1561 bool RegisterContentViewCore(JNIEnv* env) { |
1571 return RegisterNativesImpl(env); | 1562 return RegisterNativesImpl(env); |
1572 } | 1563 } |
1573 | 1564 |
1574 } // namespace content | 1565 } // namespace content |
OLD | NEW |